nginx+php一直纠结于path_info,在php中开启path_info很不安全。
nginx配置:
location ~ \.php(.*)$ {
root /web;
sendfile on;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME /web$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
# fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
# fastcgi_param PATH_TRANSLATED $servername$fastcgi_path_info;
include fastcgi_params;
}
阅读(2051) | 评论(0) | 转发(0) |