85938

禅道nginx安装配置方法

回帖
回帖数 6
阅读数 15715
发表时间 2015-07-01 14:03:28
🦄
张涛楼主

server {
listen 80;
server_name test.pms.com;
root /data/www/pmmanage/www; 
charset utf-8;

location / {
index index.html index.htm index.php;
if (!-e $request_filename) {

#这里是rewrite规则
rewrite ^(.*)$ /index.php?s=$1 last;
break;

}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

#一下是针对pathinfo配置
location ~ \.php {
root /data/www/pmmanage/www;
include /etc/nginx/fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
#将文件地址赋值给变量 $real_script_name
set $real_script_name $1;
#将文件地址后的参数赋值给变量 $path_info
set $path_info $2;
}
#配置fastcgi的一些参数
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
}

2015-07-01 14:07:51 张涛 最后编辑
6个回复
🦄
张涛沙发

http://www.qttc.net/201208199.html

附上一篇nginx配置文章

2015-07-01 14:08:59 张涛 回帖
🍟
春哥板凳
感谢分享。:) 加50积分。
2015-07-01 17:23:52 王春生 回帖

共享我这边nginx的站点配置文件.

也是用php-fpm fastcgi


server{

listen 8091;
server_name pms.sj.com;
root /home/sj/zentaopms/www;
index index.php;


#location ^~ /(data|js|theme) {
# rewrite ^/(.*)$ /$1 break;
# }
location ~ \.php$ {
root /home/sj/zentaopms/www;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
}
}

2015-08-05 09:30:33 Cobra 回帖
🐸
奔跑的蜗牛#4
谢谢分享
2015-12-01 15:04:00 奔跑的蜗牛 回帖
感谢分享。没有试过!
2015-12-15 20:01:45 neo 回帖
🐧
我要散播负能量#6
感谢分享
2016-03-11 18:29:19 我要散播负能量 回帖
联系我们
联系人
杨苗/高级客户经理
电话(微信)
13165050229
QQ号码
2692096539
联系邮箱
yangmiao@chandao.com
返回顶部
客服头像
杨苗
高级客户经理
客服微信
13165050229
2692096539
统一服务热线 4006-8899-23
我要提问提问有任何问题,您都可以在这里提问。问题反馈反馈点击这里,让我们聆听您的建议与反馈。