Skip to content

Instantly share code, notes, and snippets.

@trident523
Last active February 3, 2019 16:18
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save trident523/ee1be110212b4a7a1291 to your computer and use it in GitHub Desktop.
Save trident523/ee1be110212b4a7a1291 to your computer and use it in GitHub Desktop.
Simple NGINX forwarding
upstream discourse {
#fail_timeout is optional; I throw it in to see errors quickly
server 127.0.0.1:4578 fail_timeout=5;
}
# configure the virtual host
server {
# replace with your domain name
server_name discourse.example.com;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
# pass to the upstream discourse server mentioned above
proxy_pass http://discourse;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment