Created
November 5, 2015 07:26
-
-
Save khanhicetea/b8555ea0a620e38aa361 to your computer and use it in GitHub Desktop.
NginX https redirect ( Cloudflare's flexible ssl )
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
server { | |
listen 80; | |
server_name example.com www.example.com; | |
if ($http_x_forwarded_proto = "http") { | |
return 301 https://$server_name$request_uri; | |
} | |
... directives to generate a response | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is brilliant! i didn't have to use $scheme and some of the scripts cause redirect loops!