问题:
404 Not Found
nginx/1.4.4
解决:
1.nginx wiki给出了基于配置文件的方法
fastcgi_split_path_info
Syntax: fastcgi_split_path_info regex
Default:
Context: location
Reference: fastcgi_split_path_info
This directive allows the setting of the SCRIPT_FILENAME (SCRIPT_NAME) and PATH_INFO variables of the CGI specification. The regex consists of two groups:
path to the script that will handle the request — corresponding to $fastcgi_script_name.
the value of the parameter to be given to the script — corresponding to the $fastcgi_path_info.
Here's an example. The script show.php receives as argument the string article/0001. The following configuration will handle path splitting properly:
location ~ ^.+\.php { #我实际使用的是 \.php/?.*$
(...)
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
(...)
}
将斜体放入fastcgi的php脚本中,问题就可以解决
阅读(8401) | 评论(0) | 转发(0) |