400 bad request request header or cookie too large nginx Rails app

July 8, 2013 35.4k views
Hi, I am getting 400 bad request request header or cookie too large nginx with my Rails app, restarting browser fixes the issue. I am only storing a string id in my cookie so it should be tiny. Where can I find the nginx error logs? I looked at nano /opt/nginx/logs/error.log, but it doesn’t have anything related.. Any help Thx Leo
1 comment
6 Answers
Try increasing the large_client_header_buffers directive in nginx,

server {
...
large_client_header_buffers 4 16k;
...
}
Try clearing your browser's cookies, does that fix it?
Yes, it dose.

But it will come back again. I cannot find anything wrong with my code. So what is the best way to debug this? like I said I cannot find anything in /opt/nginx/logs/error.log

thx
Leo
thanks buddy its fix my issue

Regards,
Owais
Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!