eremiter 发表于 2014-05-10 14:06

网站从apache移到nginx变成无法访问了

本帖最后由 eremiter 于 2014-05-10 14:07 编辑

nginx/1.2.7

可能是路径无法跳转的原因,我参考了nginx 不支持pathinfo, 你可以自己配置一个pathinfo变量, 会有安全漏洞,你又要修复, 很麻烦。 nginx 最好是不要用pathinfo, thinkphp可以在不支持pathinfo的环境下用, 也同样能到达pathinfo效果。
配置方法:
1,nginx配置:
location / {
.....省略部分代码
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}配置了 /usr/local/nginx/conf/vhost/ 下的域名配置文件如下,还是不行,不知是文件放错了,还是其它原因server
      {
                listen       80;
                server_name   www.abctest.cn abctest.cn;
                index index.html index.htm index.php default.php default.html;
                root/home/wwwroot/abctest;

                location ~ .*\.(php|php5)?$
                        {
                              try_files $uri =404;
                              fastcgi_passunix:/tmp/php-cgi.sock;
                              fastcgi_index index.php;
                              include fcgi.conf;
                        }

                location /status {
                        stub_status on;
                        access_log   off;
                }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                              expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                              expires      12h;
                        }

location / {

if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
      }系统是这个的 http://down.chinaz.com/soft/26012.htm

ccddtt 发表于 2014-05-16 16:35

不能访问,出什么错?
你自己只写结果,那你就自己尝试吧:lol

action08 发表于 2014-05-17 06:36

fastcgi_passunix:/tmp/php-cgi.sock;


这个靠谱么??
页: [1]
查看完整版本: 网站从apache移到nginx变成无法访问了