Nginx proxy header for rails and SSL

March, 24 2008 10:30 AM
Something that comes up at work often is the fact that nginx is missing a configuration in the location block of the SSL server block. The problem is that rails needs https headers to be sent directly to it in order to recognize it's an ssl request. Here is the configuration you need:

location / {
proxy_set_header X_FORWARDED_PROTO https;
}

This is more of a note to self than anything. If someone could provide more detail on this issue, that would be great! :)
Comments:
Bryan on March, 26 2008 06:13 PM
Ask Igor Sysoev

Send me some feedback!

Author:

Body:

About Lancelot Carlson and this blog

I created this blog from scratch using rails at a lightning quick pace. I figure, why not walk the walk and use my blog as a testing bed for all those ruby/rails ideologies I evangelize. Here you will find not only a digest of my learnings and brain dumps about topics ranging from Ruby to Nginx to Search Engine Optimization, but also a laboratory. This is a place where the mad programmer in me can test my crazy ideas and code in the wild and hopefully get enough interest to warrant some feedback.

Feel free to check out my working with rails profile for more information on me here.