Created
July 29, 2020 06:24
-
-
Save darkcolonist/a53b950d063038a0b65caec41809d791 to your computer and use it in GitHub Desktop.
redirect to https behind haproxy, behind loadbalancer, behind cloudflare
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
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
# RewriteCond %{HTTP:X-Forwarded-Proto} !https # commenting this out because: cloudflare -> haproxyLoadbalancer -> php70server | |
RewriteCond %{HTTP:CF-Visitor} !https | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
works with flexible, has some problems with full i think
January 07, 2021 11:07 am last tested with cloudflare > haproxy > app.server then no certificate issued using letsencrypt, ensure that cname has been created in cloudflare pointing to host