nginx 502 bad gateway
我們?cè)谑褂胣ginx的時(shí)候有不少問(wèn)題出現(xiàn),首先我們就來(lái)解決下nginx 502錯(cuò)誤的問(wèn)題
經(jīng) 過(guò)分析將nginx的error log打開(kāi),發(fā)現(xiàn)”pstream sent too big header while reading response header from upstream”這樣的錯(cuò)誤提示,查閱了一下資料,大意是nginx緩沖區(qū)有一個(gè)bug造成的,我們網(wǎng)站的頁(yè)面消耗占用緩沖區(qū)可能過(guò)大
我們是nginx反向代理
proxy是nginx作為client轉(zhuǎn)發(fā)時(shí)使用的,如果header過(guò)大,超出了默認(rèn)的1k,就會(huì)引發(fā)上述的upstream sent too big header (說(shuō)白了就是nginx把外部請(qǐng)求給后端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"
后來(lái)原來(lái)那錯(cuò)誤沒(méi)了出了新錯(cuò)誤了 upstream timed out 超時(shí)?
server { 關(guān)鍵詞:nginx
閱讀本文后您有什么感想? 已有 人給出評(píng)價(jià)!
- 0
- 0
- 0
- 0
- 0
- 0