Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid nginx "upstream sent too big header" errors?

I'm running nginx, Phusion Passenger and Rails.

I am running up against the following error:

upstream sent too big header while reading response header from upstream, client: 87.194.2.18, server: xyz.com, request: "POST /user_session HTTP/1.1", upstream: "passenger://unix:/tmp/passenger.3322/master/helper_server.sock 

It is occuring on the callback from an authentication call to Facebook Connect.

After googling, and trying to change nginx settings including proxy_buffer_size and large_client_header_buffers is having no effect.

How can I debug this?

like image 689
netflux Avatar asked Feb 21 '10 19:02

netflux


2 Answers

Came across this error recently.

Since Passenger 3.0.8 there is now a setting that allows you to set the buffers and buffer size. So now you can do

http {     ...     passenger_buffers 8 16k;     passenger_buffer_size 32k; } 

That resolved the issue for me.

like image 114
Rob Di Marco Avatar answered Sep 23 '22 01:09

Rob Di Marco


Try to add this to the config:

http {     ...     proxy_buffers 8 16k;     proxy_buffer_size 32k;     } 
like image 41
Antiarchitect Avatar answered Sep 25 '22 01:09

Antiarchitect