临海小憇

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 4165|回复: 0
打印 上一主题 下一主题

nginx配置PHP访问简化推荐

[复制链接]

100

主题

121

帖子

8552

积分

论坛元老

Rank: 8Rank: 8

积分
8552
跳转到指定楼层
楼主
发表于 2017-8-29 14:15:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
server{
	listen       80;                     # 多站点(.conf),指定 listen,server_name ,root 的值。
	server_name  exam.lake1984.cn;
	root  /usr/local/server/www/exam;

	location / {
			   index index.php index.html index.html;     #添加index.php
		   }

	location ~ \.php$ {                                         #取消FastCGI 部分的注释,内容如下:
			   fastcgi_pass   127.0.0.1:9000;
			   fastcgi_index  index.php;
			   fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;  
			   include     fastcgi_params;
	}                                                             

}


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|临海小憇 ( 鲁ICP备16010828号-2

GMT+8, 2024-4-20 07:57 , Processed in 0.043926 second(s), 8 queries , File On.

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表