nginx 502 bad gateway
我們在使(shǐ)用(yòng)nginx的(de)時候有不少問題出現,首先我(wǒ)們就(jiù)來解決下nginx 502錯誤的問題
經(jīng) 過(guò)分析將(jiāng)nginx的error log打開(kāi),發現”pstream sent too big header while reading response header from upstream”這樣的錯誤提示,查閱了一下資料,大意是nginx緩衝區有一個bug造(zào)成的,我們網(wǎng)站的頁(yè)麵消耗占用(yòng)緩衝區可能(néng)過(guò)大
我們是nginx反(fǎn)向代理(lǐ)
proxy是nginx作為client轉發時使用的(de),如(rú)果header過大,超出(chū)了默認的1k,就會引發上述的upstream sent too big header (說白了就(jiù)是nginx把外部請求給後端apache ,apache返回的header
#添(tiān)加這3行 ,
............
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on
011/01/07 11:12:57 [error] 10770#0: *38585340 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 116.22.131.154, server: *.xywy.com, request: "GET /ysmp/index.php?did=124994 HTTP/1.0", upstream: "http://127.0.0.1:8080/ysmp/index.php?did=124994", host: "xywy.yn16.com"
後來原來那錯誤沒了出了新錯誤了 upstream timed out 超時?
server { 關(guān)鍵詞(cí):nginx
閱讀本文後您有什(shí)麽(me)感想? 已有 人給(gěi)出(chū)評(píng)價!
- 0
- 0
- 0
- 0
- 0
- 0