502 bad gateway - upstream sent too big header while reading response header from upstream

490 views
Skip to first unread message

Eric Falcao

unread,
Feb 15, 2010, 10:08:35 AM2/15/10
to Phusion Passenger Discussions
Hi Everyone, this issue has been hurting me pretty badly so I'm hoping
someone else has seen and fixed this:

I have a rails request which generates a long redirect url, over 1k
chars unfortunately, here is how things proceed

- user can use the entire site fine
- users posts to the action with the long redirect
- rails app processes and send back the redirect
- i see "upstream sent too big header while reading response header
from upstream" in the nginx log
- 502 bad gateway in the web browser

After searching, I have tried various permutations of:

fastcgi_buffers, fastcgi_buffer_size, proxy_buffers, proxy_buffer_size
and none have worked.

Any advice?

Hongli Lai

unread,
Feb 15, 2010, 10:46:35 AM2/15/10
to phusion-...@googlegroups.com

It's got nothing to do with buffer sizes. Nginx simply refuses to
accept response headers that are larger than a certain limit for
security reasons. You should check which headers your web app are
exactly sending and verify whether that's normal.

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Reply all
Reply to author
Forward
0 new messages