Skip to content

Instantly share code, notes, and snippets.

@eric-wu
Last active October 27, 2022 01:45

Revisions

  1. Eric Wu revised this gist Sep 6, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@
    # LB -- Load Balancer
    # RP -- Reverse Proxy
    #
    # IMPORTANT: Remove the line `include /etc/nginx/sites-enabled/*`
    # IMPORTANT: Remove the line `include /etc/nginx/sites-enabled/*` from this config
    #
    http {

  2. Eric Wu revised this gist Sep 6, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,8 @@
    # LB -- Load Balancer
    # RP -- Reverse Proxy
    #
    # IMPORTANT: Remove the line `include /etc/nginx/sites-enabled/*`
    #
    http {

    ##
  3. Eric Wu revised this gist Jan 22, 2014. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,12 @@
    # This sets up a nginx reverse proxy behind a load balancer and in front of
    # the Play web app. The setup is illustrated as the following:
    #
    # LB:80 ==> RP:80 ==> (Redirect to https)
    # LB:443 ==> RP:8080 ==> Backend:9001
    #
    # LB -- Load Balancer
    # RP -- Reverse Proxy
    #
    http {

    ##
  4. eric-wu created this gist Jan 17, 2014.
    36 changes: 36 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    http {

    ##
    # Reverse proxy
    ##

    proxy_buffering off;
    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Scheme $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;

    upstream dashboard-backend {
    server localhost:9001;
    }

    server {
    listen 8080;
    server_name dashboard.synapse.org;
    location / {
    proxy_pass http://dashboard-backend;
    }
    }

    ##
    # Redirect http to https
    ##

    server {
    listen 80;
    return 301 https://$host$request_uri;
    }
    }