location / {
index index.html index.htm index.php;
if (!-e $request_filename) { #这个if语句里面是要必加的
rewrite ^/(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ \.php {
set $script $uri;
set $path_info "/";
if ($uri ~ "^(.+\.php)(/.+)") {
set $script $1;
set $path_info? $2;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
tp3 nginx伪静态
最新推荐文章于 2024-07-26 13:52:53 发布