thinkphp nginx环境配置

时间:2025-09-06 11:15:01来源:互联网

下面小编就为大家分享一篇thinkphp nginx环境配置,具有很好的参考价值,希望对大家有所帮助。

server {
listen 80;
server_name _;
#root /var/www/html;
root /var/www/html/erp/public;

index index.php index.html index.htm;

location / {
#try_files $uri $uri/ /index.php?$query_string;
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?s=/$1 last;
break;
}
}

# 处理 PHP 脚本
location ~ .php$ {

include fastcgi_params;
fastcgi_pass 127.0.0.1:9000; # php-fpm 的监听地址
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}

 https://blog.c*s**dn.net/chendongpu/article/details/126224100

本站部分内容转载自互联网,如果有网站内容侵犯了您的权益,可直接联系我们删除,感谢支持!