Created
March 1, 2016 19:12
-
-
Save adamxp12/97f833597e0ac539a2eb to your computer and use it in GitHub Desktop.
Force SSL through htaccess when behind a proxy like varnish
This file contains 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
# Force SSL when infront of a proxy like nginx or varnish | |
# Easier to do it in apache than at the proxy side as varnish is a pain 100% of the time to configure | |
# and no point configuring it in nginx as thats only the SSL terminator, at least in my setup | |
RewriteEngine On | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
RewriteRule ^(.*)$ https://adamxp12.com/$1 [R,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment