具体看代码,很简单,我对比了半天,其它都不用管
server {
listen 80;
server_name xxxxx;
return 301 https://$host$request_uri;
}
server{
listen 443 ssl http2;
server_name xxx.com;
root /app/yy/public;
index index.html index.htm index.php;
# 这里ssl相关的代码已经移除了,想弄ssl的自行搜索,本文不是让你看ssl解决方案的
#伪静态
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
location ~ .*\.php(\/.*)*$ {
### 只需要确认是否有这行代码
fastcgi_split_path_info ^(.+?\.php)(/.+)$;
}
}
评论 (0)