nginx codeigniter 502 错误网关

2023-12-01

nginx的配置如下:

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

请大家给我一些建议,谢谢~


我终于自己改正了。

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;
    }
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

nginx codeigniter 502 错误网关 的相关文章

  • Nginx 正在向 uWSGI 发出非常旧的请求?

    我看到一种奇怪的情况 Nginx 或 uwsgi 似乎正在建立一个很长的传入请求队列 并在客户端连接超时后很长时间内尝试处理它们 我想理解并停止这种行为 以下是更多信息 My Setup 我的服务器使用 Nginx 通过 Unix 文件套接
  • Node + Express + Nginx 未设置 Cookie

    我有一个使用 Express 的 Node 应用程序 我尝试为我的客户端设置 cookie 它在本地环境 http 上运行良好 但是一旦我投入生产 https 我就很好地收到了cookie 我可以在响应中看到它 但它没有设置 任何想法 Ng
  • 我怎样才能重写这个nginx“if”语句?

    例如 我想这样做 if http user agent MSIE 6 0 http user agent MSIE 7 0 etc etc rewrite ROOT ROOT ancient last break 而不是这个 if http
  • NGinx 域名重定向

    假设我有一个名为 xyz co 的网站 我还有其他具有相同前缀的域名 例如 xyz com xyz it xyz co it 现在 nginx 与端口 80 的 nginx conf 中的 server name xyz co 配合得很好
  • stdClass 类的对象无法转换为字符串

    我现在在使用 PHP 时遇到问题 收到此错误 Object of class stdClass could not be converted to string当我在我的网站中运行这部分代码时发生错误 function myaccount
  • codeigniter core/model.php 未定义属性

    我从未接触过 model php 文件 但是我收到了此错误 Jobprocess 是我的控制器 lastname是在其中正确分配的变量 我不知道为什么会出现这个错误 这是使用 codeigniter 框架 Message Undefined
  • Codeigniter 分页不呈现分页链接

    你好我有以下代码 this gt load gt library pagination this gt data products this gt products model gt get products and category th
  • WebSockets 监听 UNIX 域套接字?

    是否可以在 nginx 服务器后面设置一个 WebSockets 服务器来处理 UNIX 域套接字上的连接 我目前在同一台计算机上有多个 WebSocket 服务器实例 并且存在端口共享问题 所有实例都必须分配一个唯一的端口 我想避免这种情
  • Codeigniter 如何清理输入?

    我正在构建一个 Codeigniter 应用程序 并且正在尽最大努力防止 SQL 注入 我正在使用 Active Record 方法来构建我的所有查询 我知道 Active Record 会自动清理输入 但我想知道到底清理到什么程度 它只是
  • 用于货币转换的php脚本

    我正在寻找一个可以进行货币转换的 php 脚本 在哪里可以找到与 codeigniter 配合使用的工具 取自http www ecb europa eu stats exchange eurofxref html index en htm
  • nginx 匹配位置中的特定单词

    我在匹配 nginx request body 变量中的特定单词时遇到问题 如果正文请求中有特殊单词 我想代理传递 所以我的方法是这样的 location php if request body proxy pass http test p
  • 如何在codeigniter中引用数据库连接?

    如何在 CodeIgniter 数据库处理程序对象中手动调用 PHP 数据库函数 如何检索连接 dbc 或者调用类似的函数mysql real escape string dbc variable 您可以调用任何 mysql 本机函数并访问
  • CodeIgniter:使用多维 POST 数据验证表单

    所以框架是CodeIgniter 2 0 2 我有一个表单 其中包含与数据库中的行相对应的字段组 字段名称的格式为 opt 0 foo opt 0 bar opt 1 foo opt 1 bar etc 索引 1 2等 并不对应于数据库中的
  • Http POST 删除 URL 中的端口

    我有一个用 Django 构建的网络应用程序 我目前正在家里的路由器后面的笔记本电脑上运行它 我将路由器配置为将发送到特定端口的所有流量路由到该笔记本电脑 我将 Nginx 作为 Apache 的反向代理 使用 mod wsgi 来运行 D
  • nginx server_name 在流块内可能吗?

    目前设置如下 stream server listen 9987 udp server name subdomain EXAMPLE com this line is resulting in an error proxy pass loc
  • nginx 和 uwsgi 非常大的文件上传(>3Gb)

    也许有人知道该怎么做 我正在尝试上传大于 3Gb 的文件 没问题 如果我使用以下配置上传高达 2Gb 的文件 Nginx client max body size 5g client body in file only clean clie
  • nginx位置正则表达式,匹配多次

    如何在 nginx 位置正则表达式中多次匹配 看来 x x 语法永远不起作用 例如 location abc w 1 3 从来不工作 您必须引用包含以下内容的位置 or 人物 location abc w 1 3 否则 nginx 将其解析
  • 连接到上游时 Nginx 错误:(13:权限被拒绝)

    我在我的中收到此错误nginx error log file 2014 02 17 03 42 20 crit 5455 0 1 connect to unix tmp uwsgi sock failed 13 Permission den
  • 多个where条件codeigniter

    如何将此查询转换为活动记录 UPDATE table user SET email email last ip last ip where username username and status status 我尝试将上面的查询转换为 d
  • 如何修复 Nginx 自动 301 重定向到带有尾部斜杠的相同 URL?

    当我尝试将 Web 应用程序的子目录中的索引文件访问到相同的 URL 但附加了斜杠 时 Nginx 出现了不良行为 它正在重新路由请求 我有一个简单的 Web 应用程序 其中设置了一个根目录和其中的许多子目录 每个子目录中都有一个 inde

随机推荐