gpt4 book ai didi

firefox - Nginx 502 Bad Gateway 错误仅在 Firefox 中

转载 作者:行者123 更新时间:2023-12-04 05:15:09 26 4
gpt4 key购买 nike

我在本地运行一个网站,所有流量都通过 NGinx 路由,然后将请求发送到 PHP 页面到 Apache 并提供静态文件。在 Chrome、Safari、IE 等中完美运行。

但是,每当我在 Firefox 中打开网站时,都会出现以下错误:

502 Bad Gateway
nginx/0.7.65

如果我清除缓存和 cookie,然后重新启动 FireFox,我可以在错误返回之前加载站点一两次。我已经尝试过 Firefox 3.6 和 3.5 并且都有同样的问题。

这是我的 Nginx 配置的样子:
worker_processes  2;

events {
worker_connections 1024;
}


http {

server {
listen 80;
server_name local.mysite.amc;
root /Users/joshmaker/Sites/mysite;

error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;

location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://local.mysite.amc:8080;
}

include /opt/local/etc/nginx/rewrite.txt;
}
server {
include /opt/local/etc/nginx/mime.types;

listen 80;
server_name local.static.mysite.amc;
root /Users/joshmaker/Sites/mysite;

error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
}
}

这是 Firefox 在我的 error.log 文件中生成的错误:
[error] 11013#0: *26 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream     
[error] 11013#0: *30 upstream sent too big header while reading response header from upstream
[error] 11013#0: *30 no live upstreams while connecting to upstream

我完全不知道为什么浏览器会导致服务器错误。有人可以帮忙吗?

最佳答案

我似乎找到了解决我问题的方法。经过一些额外的谷歌研究,我在我的 Nginx 配置中添加了以下几行:

proxy_buffers 8 16k;
proxy_buffer_size 32k;

但是,我仍然不知道为什么这有效,为什么只有 Firefox 似乎有问题。如果有人可以阐明这一点,或提供更好的解决方案,将不胜感激!

关于firefox - Nginx 502 Bad Gateway 错误仅在 Firefox 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3704626/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com