开发者

Sporadic 400 Bad Request Error nginx/0.7.67 with Heroku and Rails 3

UPDATE: This bug appears to be Browser Specific to Chrome. I've clicked the link about 50 times each in Firefox and IE and I can't seem to cause it. Also, once it is occurring, I can switch to FF or IE and it'll work fine on those two.

I have a particular page in my Rails 3 application on heroku that loads fine for awhile. I can click the same page and it loads without a problem. 开发者_StackOverflow中文版 But after a certain number of loads, it suddenly starts to give me a 400 Bad Request Error with nginx/0.7.67 below it.

After it occurs once, everytime I load the page I get the 400 error. But if I leave the application alone for awhile, overnight for example, the page works again in the morning for a short while. But if I click the page a few times, it begins giving me that error again.

It's not something that occurs locally so it seems like it must be a heroku issue.

I also tried restarting heroku but that doesn't help. The only thing that seems to help is giving it some time off.

The heroku logs don't give me any new info as far as errors. Everything appears to be working fine and then I get a line that ends 727 | https | 400 and it just stops.

I'm using https if that helps.

The full error heroku log is:

[33m2011-07-02T15:25:59+00:00 heroku[nginx]: <-[0m GET /matters/show/34 HTTP/1.1 | 10.212.125.194 | 727 | https | 400

Let me know what code from this page would help solve this problem if you have an idea.


So after a long back and forth with the Heroku Support staff we finally found the issue. I was using Datatables in various places around my site and using cookies to store user state settings. That cookie was getting longer and longer and longer as a user navigated around the site until my header surpassed the maximum header size allowed by NGINX (8K).

The solution was to remove/simplify that cookie or switch from nginx Heroku (bamboo) to a Heroku stack that didn't use nginx (cedar).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜