1. 程式人生 > >Nginx 顯示502 Bad Gateway錯誤

Nginx 顯示502 Bad Gateway錯誤

二維碼 div 名稱 ear 配置 star 成功 art edi

今天系統發布到測試環境,有一個用戶登錄後顯示502 Bad Gateway錯誤,其他的用戶都登錄成功。但是在開發機鏈接測試數據庫,使用該賬號登錄成功。

初步猜測是Nginx的問題,查看nginx的錯誤日誌,得到以下錯誤信息:

upstream sent too big header while reading response header from upstream

按字面意思理解應該是upstream負載均衡的模塊轉發的header頭超出限制值了,cookie攜帶的header太長了。

解決方法:修改nginx配置,調整大小,

A little on the safe side, but try to increase the cookie size in nginx:

proxy_buffer_size 512k;

proxy_buffers 3232k;

proxy_busy_buffers_size 512k;

restart nginx, clear cookies and try it again.

歡迎大家關註微信號,微信公眾號名稱:DotNet修煉寶典。 掃下面的二維碼或者收藏下面的二維碼關註吧(長按下面的二維碼圖片、並選擇識別圖中的二維碼)

技術分享圖片

Nginx 顯示502 Bad Gateway錯誤