apache项目迁移到nginx,遇到path问题

By | 2013 年 8 月 5 日

server {
listen 80;
server_name test.musilin.net.cn;

#charset utf8;
#access_log /data/logs/www.musilin.net.cn_access.log main;

root /data/wwwroot/test.duost.com;
index index.html index.php index.htm;

#error_page 404 /page/404.html;
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root html;
#}

location ~ \.php($|/) {
set $script $uri;
set $path_info "";
if ($uri ~ "^(.+\.php)(/.+)") {
set $script $1;
set $path_info $2;
}
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$script;
fastcgi_param SCRIPT_NAME $script;
}

}

发表回复

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据