Created
November 1, 2017 03:47
-
-
Save maskshell/70641c3a33704fe7bf1b713e2fdbf9bb to your computer and use it in GitHub Desktop.
Revisions
-
Bob Rasey revised this gist
Dec 20, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # HAProxy behind AWS ELB: how to force HTTPS? ## What are you trying to solve You have some nodes in AWS that you want to load balance. -
Bob Rasey renamed this gist
Dec 20, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Bob Rasey created this gist
Dec 20, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ # HAProxy behing AWS ELB: how to force HTTPS? ## What are you trying to solve You have some nodes in AWS that you want to load balance. You want to use the magical scaling properties of ELB. You want to do some things that ELB doesn't do, like force HTTPS (or add headers, or something else). ## The architecture Set up an ASG of HAProxy nodes that associates with your ELB. Include these lines in your haproxy.cfg ```ini acl http req.hdr(X-Forwarded-Proto) http redirect scheme https if http ``` ## How does this work? Amazon conveniently sets the X-Forwarded-Proto header on incoming requests. See [this doc](https://aws.amazon.com/premiumsupport/knowledge-center/redirect-http-https-elb/) for more info.