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