Created
July 16, 2014 10:34
-
-
Save kazuph/08ec26e04affb47217de to your computer and use it in GitHub Desktop.
nginx+ELBでhttps/http毎に行う処理を変えたい ref: http://qiita.com/kazuph/items/73777454375e6e4c235f
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
location = / { | |
+ if ($http_x_forwarded_proto = "https") { | |
+ rewrite ^(.*) http://$server_name$1 | |
+ break; | |
+ } | |
... | |
} | |
location / { | |
+ if ($http_x_forwarded_proto != "https") { | |
+ rewrite ^(.*) https://$server_name$1 | |
+ break; | |
+ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment