Thinkphp 伪静态Nginx配置方式

来源:互联网 发布:淘宝直播货源 编辑:程序博客网 时间:2024/05/16 01:49

server {
listen 80;
server_name promotion.admin.xxxx.cn;
location /

root /www/os_promotion; index index.html index.htm index.php; 
include /www/os_promotion/.htaccess; 
}
error_page 500 502 503 504 /50x.html;
location = /50x.html
{
root html;
}
location ~ \.php$ 
{
root /www/os_promotion;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#支持 THINKPHP URL_MODEL 1 #######
#fastcgi_param SCRIPT_FILENAME /www/os_promotion/scripts$fastcgi_script_name;
include fastcgi.conf;
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.?\.php)(/.)$")

set $real_script_name $1; 
set $path_info $2; 
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
#支持 THINKPHP URL_MODEL 1 #######
}
}

0 0
原创粉丝点击