-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper Nginx Config #26
Comments
This is not a bug in rack-ssl-enforcer, but rather your Nginx setup. Nginx proxies the incoming request to Rails, but Rails is not notified about the protocol that's being use. If you check https://github.com/tobmatth/rack-ssl-enforcer/blob/master/lib/rack/ssl-enforcer.rb#L59 you'll notice that a HTTP header is inspected to see if SSL was used or not. In your Nginx config add the following to your
Restart Nginx and you're good to go. |
ariejan, thanks for your reply. I made the nginx server configuration you suggested, but I am still getting the infinite loops. Here is the location stanza: https://gist.github.com/dad787fae02fed95fe1c any suggestions? |
@ariejan, @creativeallies Is there any news/solutions for this? I'd like to close the issue since it's not related to the gem anymore. :) Thanks! |
Hey guys, it's working for us with this nginx config:
|
Awesome, thanks for the tip! I close the issue now. :) |
I know this is an old issue but I ran into it again when deploying to a new environment. Apparently I also need to have:
in my nginx config or the non-https urls will get a redirect loop. |
Hey guys, I have tried everything that I can read online about SSL::Enforcer, Nginx and Unicorn, but no matter what I try, I always get an infinite loop. If I use Nginx to enforce SSL, it works just fine, but I would really prefer a software based solution. Is there a recommended example Nginx ssl confg? I appreciate any and all help!
The text was updated successfully, but these errors were encountered: