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