本文是基于phpstudy的配置,做个记录:
然后在vhosts.conf文件中添加一段代码即可:
server {
listen 80;
server_name www.funsinx.com www.funsinx.com;
root "D:\workspace\funsinx\public";
location / {
index index.html index.htm index.php;
#autoindex on;
autoindex off;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}
保存并重启 Nginx
,必须要重启 Nginx
才会生效!
Comments