繁体   English   中英

502 错误网关 Nginx

[英]502 Bad Gateway Nginx

已编辑:此错误仅在我使用 Chrome 时发生。 如果我切换到 Safari 或 FireFox,我的服务器代码工作正常。

这是错误日志。 请帮忙。 我正在玩 Google OAuth 2.0 API 并且在 Google 回拨我的服务器后出现问题。

如果您需要更多信息来诊断,请告诉我。 (我是一个超级新手,所以我不知道在这里粘贴什么......)

此外, 114.247.XXX.YYY是我的本地办公室 IP,我通过它浏览网站和访问远程服务器。

2012/06/28 09:54:08 [error] 2170#0: *21 upstream sent too big header
while reading response header from upstream, client: **114.247.XXX.YYY**,
server: my_domain_name.com, request: "GET
/login-callback/google?state=my_randomly_generated_state&code=my_google_authorization_code
HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "my_domain_name.com"

好的,我也有这个问题,但是在每个浏览器中。

验证是否不监听套接字。

纳米/etc/php5/fpm/pool.d/www.conf

我的解决方案是:

$ sudo nano /etc/nginx/sites-available/default

server {
[...]
location ~ \.php$ {
  root /your/site/root;
  fastcgi_index index.php;
  include fastcgi_params;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

  fastcgi_pass 127.0.0.1:9000;
  #IF you are using a socket change the line above for thise one:
  #fastcgi_pass    unix:/var/run/php5-fpm.sock;

  ###to be sure validate on /etc/php5/fpm/pool.d/www.conf
  ####listen = 127.0.0.1:9000 #not a socket
  ####listen = /var/run/php5-fpm.sock #listen a socket


  # add these two lines:
  fastcgi_buffer_size 16k;
  fastcgi_buffers 4 16k;
}
[...]
}
$sudo service nginx restart

来源: 点击这里

使用您的 VPS IP 更改本地主机。为我工作

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM