access_log logs/ww2_com_80.log main;
root /var/www/html;
index index.htm index.html index.php;
default_type 'text/plain';
location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#加载Nginx默认"服务器环境变量"配置
include fastcgi.conf;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
location ~ /(server|manager)($|/)(.*) {
try_files $uri /$1/index.php$2$3?$query_string;
}#$1, $2 ,$3 分别对应了上面三个括号匹配的内容
location / {
try_files $uri /index.php$uri?$query_string;
#使用try_files 做定向必须在最后指定query_string变量,否则php取不到GET请求参数
}
上面配置,有问题的地方大家指出来。