簡體   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