Created
May 2, 2013 12:27
-
-
Save robmiller/5501879 to your computer and use it in GitHub Desktop.
Set `$_SERVER['HTTPS']` in nginx, in the same way as it's done in Apache; this is necessary for example in WordPress, where the `is_ssl` check will otherwise fail (causing a redirect loop if you have `FORCE_SSL_ADMIN` on).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The best place to put this is your `fastcgi_params` file. | |
set $_ssl "off"; | |
# We run SSL on ports 443+, not just one port, to get | |
# around the lack of SNI in clients' browsers; you might | |
# safely be able to use "$server_port = 443" | |
if ( $server_port != 80 ) { | |
set $_ssl "on"; | |
} | |
fastcgi_param HTTPS $_ssl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment