Nginx 反代 upstream sent too big header

今天突然几个站点打不开了,出现了502 错误,赶紧打开nginx error log, 发现了这个错误:

upstream sent too big header while reading response header from upstream, client: XX.XX.XX.XX

这个错误很明显,是nginx proxy buffer 不够了,解决的办法很简单,直接在http block 里面添加如下命令即可:

proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;

添加完毕重启即可解决上述问题.

同时这也说明了在监控中,不仅要检查nginx,mysql 的程序运行情况,也要检查http status, 只有200的情况是可以接受的

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.