ThinkPHP在nginx下怎么设置

 我来答
只为你66守候
2017-10-15 · TA获得超过388个赞
知道小有建树答主
回答量:1593
采纳率:31%
帮助的人:291万
展开全部
location / {
index index.php;
if (!-e $request_filename) {
rewrite ^/(.*)index.php(.*)$ $1/index.php?s=$2 last; //关键语句
break;
}
}
新加“rewrite ^/(.*)index.php(.*)$ $1/index.php?s=$2 last;” 然后 用thinkphp 通用的兼容的解析方法处理,问题得到解决~
另外可以再解析php的改成如下:
location ~ .php($|/) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /usr/data0/wwwroot/$fastcgi_script_name;
include fastcgi_params;
}这样就行,希望能帮到你,我还要在后盾人听讲课呢,就这样吧✧٩(ˊωˋ*)و✧
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式