Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save maskshell/70641c3a33704fe7bf1b713e2fdbf9bb to your computer and use it in GitHub Desktop.

Select an option

Save maskshell/70641c3a33704fe7bf1b713e2fdbf9bb to your computer and use it in GitHub Desktop.

Revisions

  1. Bob Rasey revised this gist Dec 20, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion HAProxy behind AWS ELB: how to force HTTPS?.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # HAProxy behing AWS ELB: how to force HTTPS?
    # 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.
  2. Bob Rasey renamed this gist Dec 20, 2016. 1 changed file with 0 additions and 0 deletions.
  3. Bob Rasey created this gist Dec 20, 2016.
    21 changes: 21 additions & 0 deletions HAProxy behing AWS ELB: how to force HTTPS?.md
    Original 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.