您的位置: 首页> PHP源码> thinkphp nginx环境配置

thinkphp nginx环境配置

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

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

上一篇:php 设计模式 下一篇:win11结合wsl2搭建开发环境之四:基于wsl子系统Ubuntu24.04,编译安装php8.4

相关文章

相关应用

最近更新