Skip to content

Instantly share code, notes, and snippets.

@patrickhulce
Created March 20, 2018 21:21
Show Gist options
  • Select an option

  • Save patrickhulce/eb9fc1dd81e06793de9d2e47f57df336 to your computer and use it in GitHub Desktop.

Select an option

Save patrickhulce/eb9fc1dd81e06793de9d2e47f57df336 to your computer and use it in GitHub Desktop.
express proxy settings

from https://stackoverflow.com/questions/10183291/how-to-get-the-full-url-in-express

proxy_set_header X-Forwarded-Host $host:$server_port;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

from http://expressjs.com/en/guide/behind-proxies.html

app.set('trust proxy', ['loopback', 'linklocal', 'uniquelocal']) // specify multiple subnets as an array

from mac local nginx

        location / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
   proxy_set_header X-FQ-Url $http_host$request_uri;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://127.0.0.1:3000;
        }
        ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment