theKindOfMe

March 17, 2011

Facebook Connect, Cookies, Nginx and 400 Bad Request Errors

Filed under: Uncategorized — Tags: , — yasi8h @ 10:15 am

One of my colleagues were having a problem with getting Facebook connect to work in one of his rails apps. The strange thing was that it worked fine on his local. But when he uploaded the app to staging (which was a standard nginx/passenger/mysql/ubuntu stack), he would get a weird 400 Bad Request error after authentication and redirection from Facebook.

After googling around for a while it turned out that nginx has a limit on the request header size.

“maximum number and size of buffers for large headers to read from client request.” – from nginx documentation (http://wiki.nginx.org/NginxHttpCoreModule#large_client_header_buffers).

Increasing this solved the problem.

The current setting is at large_client_header_buffers 4 8k and it seems to work fine so far.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: