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請求參數
}
上面配置,有問題的地方大家指出來。