Nginx Log error 502 upstream sent too big header while reading response headers from upstream
The value of the cookie is out of range I mean,
Look at the log.
Error 502 upstream sent too big header while reading response headers from upstream
sudo gedit/var/log/nginx/error.log
Viewing the error log
Upstream sent too big header while reading response headers from upstream
You go to search this error, the online explanation is similar, no outside of the cookie is carrying the header too much, let you set:
Fastcgi_buffer_size 128k;
Fastcgi_buffers 8 128k;
Gradually try. Which fastcgi_buffers 8 128k This sentence, fastcgi_buffers 32k such a better, memory is the whole block allocation and release, reduce the number of K can be used as far as possible.
In addition, if you do load balancing with nginx, changing the above parameters is useless, in the forwarding configuration, such as the following settings:
Location @to_other {
Proxy_buffer_size 128k;
Proxy_buffers 32k;
Proxy_busy_buffers_size 128k;
Add_header x-static transfer;
Proxy_redirect off;
Proxy_set_header Host $host;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
Proxy_pass Http://backend; #请求转发
}
The bold three lines will not work.
Fastcgi_* can be understood to be used when Nginx accepts a response from a client request. Proxy is used when nginx as a client forwarding, if the header is too large, beyond the default of 1k, it will trigger the above upstream sent too big header.
can refer to:
Http://wiki.nginx.org/NginxHttpProxyModule
Http://blog.sina.com.cn/s/blog_5dc960cd0100i4mt.html
Other search results can be ignored and are very similar.
Location ~ \.php$ {
Fastcgi_buffer_size 128k;
Fastcgi_buffers 32k;
Include/etc/nginx/fastcgi_params;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param script_filename/host/web/$fastcgi _script_name;
}
Error 502 upstream sent too big header