禅道nginx安装配置方法
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;
}
}
共享我这边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;
}
}




