nginx codeigniter 502坏网关 [英] nginx codeigniter 502 bad gateway

查看:337
本文介绍了nginx codeigniter 502坏网关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

nginx的配置如下:

The config of nginx is as follows:

server {
        listen       80;
        server_name  www.example.com;

        root   /home/wwwroot/example.com;
        index index.php  index.html index.htm;

        location / {
                index  index.php index.html index.htm;
        }

        location ~ \.php($|/) {
            fastcgi_pass   127.0.0.1:9000;
            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;
        }

        if (!-e $request_filename) {
            rewrite ^/(.*)$ /index.php/$1 last;
            break;
        }

        location ~ /\.ht {
                deny  all;
        }
}

请给我一些建议,谢谢〜 p>

please give me some advice, thank you~

推荐答案

我终于做到了。

server {
    listen       80;
    server_name  example.com;

    root   /home/wwwroot/example.com;
    index index.php  index.html index.htm;

    location / {
    root /home/wwwroot/example.com;
            index  index.php index.html index.htm;
        if (!-e $request_filename) {
                rewrite ^/(.*)$ /index.php/$1 last;
                break;
        }
    }
    location ~ \.php($|/) {
        fastcgi_pass  unix:/tmp/php-cgi.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 ~ /\.ht {
            deny  all;
    }
}

这篇关于nginx codeigniter 502坏网关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆