Skip to content

Instantly share code, notes, and snippets.

@daveslutzkin
Last active March 3, 2016 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daveslutzkin/d315ea593d1dcb6a17ab to your computer and use it in GitHub Desktop.
Save daveslutzkin/d315ea593d1dcb6a17ab to your computer and use it in GitHub Desktop.
nginx re-resolve upstream dns
# nginx will only re-resolve a hostname for a proxy if it's a variable
set $feedback "FEEDBACK";
resolver RESOLVER; # set from $(grep nameserver /etc/resolv.conf | head -1 | awk '{ print $2; }')
location / {
proxy_pass http://$feedback;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on;
proxy_redirect off;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment