Skip to content

Instantly share code, notes, and snippets.

@joar
Last active August 29, 2015 14:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joar/1bb03c0c4890b985a973 to your computer and use it in GitHub Desktop.
Save joar/1bb03c0c4890b985a973 to your computer and use it in GitHub Desktop.
How to get rid of 127.0.0.1 in your generated links
server {
# [...]
location / {
set $backend_url 'http://127.0.0.1:8000';
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass $backend_url;
proxy_redirect $backend_url https://$server_name/;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment