如题,直接上代码
<?php
server {
listen 80;
server_name www.syj.com;
error_log D:/phpStudy/PHPTutorial/nginx/logs/www.syj.com.error.log warn;
root D:/phpStudy/PHPTutorial/WWW/syj/web;
index index.html index.htm index.php;
location / {
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root D:/phpStudy/PHPTutorial/nginx/html;
}
}
?>