Thinkphp nginx 的配置
在 /etc/nginx/sites-available 配置 default
server {
listen 80;
listen [::]:80;
server_name www.xxx.com;
root /var/xxxx/xxx;
index index.html index.php index.htm;
location ~ \.php {
#fastcgi_split_path_info ^(.+\.php)(/.+)$;
#root /opt/test/;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
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;
}
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}
}

浙公网安备 33010602011771号