December 2008 Archives

If you find your Rails application behaving a little bit "schizophrenic" regarding HTTP and HTTPS, and you are using Nginx as proxy in front of your Mongrel or Thin servers,  then is possible that you are suffering a lack of headers.

This disease is easily cured by the administration of a single dosis of:

proxy_set_header X_FORWARDED_PROTO https;

To your nginx.conf. Off course this treatment is only recommended for SSL enabled configurations.

Basically the problem is that if the header is not set, the Rails application doesn't know that the request is HTTPS, and responds with a regular HTTP response. Depending on your configuration and what are you doing with your application the problem can not arise until you get a somethinbg like a HTTP redirect from your application hitting the wrong port (443)

About this Archive

This page is an archive of entries from December 2008 listed from newest to oldest.

October 2008 is the previous archive.

January 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.