配置是WINDOW或LINUX通用的,只须要把ROOT改一下即可:
#root /var/web/website_dirname; #这是LINUX适用
root M:/web/website_dirname; #这是WINDOW适用

下面是server配置:
server {
listen 80;
server_name www.youweb.com;
#charset koi8-r;
#access_log logs/host.access.log main;
#root /var/web/website_dirname; #这是LINUX适用
root M:/web/website_dirname; #这是WINDOW适用
index index.html index.htm index.php;
location ~ \.(css|js|jpg|jpeg|png|bmp|gif|svg|ttf|woff|woff2|eot|otf|ico|css\.map|min\.map)(.)$ {
break;
}
location / {
#index index.htm index.html index.php;
#访问路径的文件不存在则重写URL转交给PHP框架处理
if (!-e $request_filename) {
rewrite ^/(.)$ /index.php/$1 last;
break;
}
}
location ~ \.php/?.$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#加载Nginx默认\"大众做事器环境变量\"大众配置
include fastcgi.conf;
#include fastcgi_params;
#设置PATH_INFO并改写SCRIPT_FILENAME,SCRIPT_NAME做事器环境变量
set $fastcgi_script_name2 $fastcgi_script_name;
if ($fastcgi_script_name ~ \"大众^(.+\.php)(/.+)$\公众) {
set $fastcgi_script_name2 $1;
set $path_info $2;
}
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name2;
fastcgi_param SCRIPT_NAME $fastcgi_script_name2;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
#error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}