nginx 502 bad gateway
我們在使用nginx的時候有不少問題出現,首(shǒu)先我們就(jiù)來解決下(xià)nginx 502錯誤的問題
經 過分析將nginx的error log打開,發現”pstream sent too big header while reading response header from upstream”這樣的錯誤(wù)提示,查閱了一下資(zī)料,大意是nginx緩衝區有一個(gè)bug造成的,我們(men)網站的頁麵消耗占用緩衝區(qū)可(kě)能(néng)過(guò)大
我們是nginx反向代理(lǐ)
proxy是nginx作為client轉發時(shí)使用的(de),如果header過大,超出了默認的1k,就會引發上述的upstream sent too big header (說白了就是nginx把外(wài)部(bù)請求給後端apache ,apache返回的header
#添加這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 { 關鍵詞:nginx
閱(yuè)讀本文後您有什麽感想? 已有 人給出(chū)評價!
- 0
- 0
- 0
- 0
- 0
- 0