root e:/thinkphp/public/;
location / {
ssi on;
ssi_silent_errors on;
index index.html index.htm index.php;
try_files $uri @rewrite;
}
location @rewrite {
set $static 0;
if ($uri ~ \.(css|js|jpg|jpeg|png|gif|ico|woff|eot|svg|css\.map|min\.map)$) {
set $static 1;
}
if ($static = 0) {
rewrite ^/(.*)$ /index.php?s=/$1;
}
}
location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
window的thinkphp的Nginx完整无错配置SSI
本文详细解析了Nginx的配置文件,包括root、location、重写规则及PHP处理等设置,旨在提高服务器性能和网站响应速度。通过对session管理、静态文件处理和PHP请求的优化,确保了高效稳定的服务运行。
摘要由CSDN通过智能技术生成