# redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; }
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php/?.*$ { root D:\\soft\\php\\tp5\\public; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; #加载Nginx默认"服务器环境变量"配置 include fastcgi.conf;
#设置PATH_INFO并改写SCRIPT_FILENAME,SCRIPT_NAME服务器环境变量 set $fastcgi_script_name2 $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") { set $fastcgi_script_name2 $1; set $path_info $2; } fastcgi_param PATH_INFO $path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name2; fastcgi_param SCRIPT_NAME $fastcgi_script_name2; } }