收藏本站 Archiver
    请 后使用快捷导航
    没有账号?入住 CI 中国社区
    查看: 4806|回复: 3

    [Others] CI2.2框架在nginx1.2出现502 Bad Gateway

    [复制链接]
    楼主
    发表于 2016年12月12日 17:02:40 | 只看该作者 回帖奖励 |倒序浏览 |
    本帖最后由 eremiter 于 2016年12月13日 10:31 编辑

    下载一个jekpos2.3.4, https://github.com/jekkos/opensourcepos 在apache运行正常
    但在nginx1.2 因PATH_INFO问题,可以登入首页,但输入用户名和密码,就会提示页面不存在。
    于是搜索相关教程设置。变成连首页都无法看到了。提示502 Bad Gateway注:nginx1.2.7是正常的,因另一网站dedecms可以正常运行

    环境:centos6.3 nginx1.2.7

    pos.test.cn 域名我换了一下,实际不是test


    PHP复制代码

    server {
    listen 80;
    server_name pos .test.cn;

    root /home/wwwroot/pos ;
    index index.php index.html default.php;

    location / {
    try_files $uri $uri/ /index.php?$query_string;
    }

    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;
    }

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

    location ~ /\.ht {
    deny all;
    }
    }
    复制代码


    下面的配置 ,可以登入首页,但输入用户名和密码,跳转到一页面,提示找不到,应该是控制器pathinfo问题

    PHP复制代码

    server
    {
    listen 80;
    server_name pos .test.cn;
    index index.html index.htm index.php default.php default.html;
    root /home/wwwroot/pos ;

    location ~ .*\.(php|php5)?$
    {
    try_files $uri =404;
    fastcgi_pass unix:/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;
    }

    }


    复制代码



    沙发
    发表于 2016年12月12日 17:14:02 | 只看该作者
    nginx 配置参考 https://www.nginx.com/resources/ ... ecipes/codeigniter/ 不要在网上搜索,很多不靠谱。
    藤椅
    楼主| 发表于 2016年12月12日 20:29:28 | 只看该作者
    Hex 发表于 2016年12月12日 17:14
    nginx 配置参考 https://www.nginx.com/resources/wiki/start/topics/recipes/codeigniter/ 不要在网上搜索 ...

    谢谢版主,这个网站无法打开,估计也是全英文,看得也累

    我干脆再去下载3.0 ,在apache2.4安装成功,但里面的菜单 store config 一点击就会卡死,郁闷
    nginx的配置要php5.5,目前是php5.3,pos3又不支持,嗨

    我的环境win10+php5.5+mysql5.5,你有空试一下嘛,谢谢
    板凳
    发表于 2016年12月13日 15:21:16 | 只看该作者
    eremiter 发表于 2016年12月12日 20:29
    谢谢版主,这个网站无法打开,估计也是全英文,看得也累

    我干脆再去下载3.0 ,在apache2.4安装成功,但里 ...

    网站打不开可能需要科学上网,另外英文内容是很有价值的。

    关于你这个开源项目,我建议直接联系作者比较好,因为这可能已经不只是 CI 框架的问题了。我没有使用过这个项目,可能帮不到你。。。
    返回列表
    您需要登录后才可以回帖 登录 | 入住 CI 中国社区

    本版积分规则

    AltStyle によって変換されたページ (->オリジナル) /