Skip to content

Instantly share code, notes, and snippets.

@scragg0x
Created July 15, 2014 14:40
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 scragg0x/738f144b33d17ef763d1 to your computer and use it in GitHub Desktop.
Save scragg0x/738f144b33d17ef763d1 to your computer and use it in GitHub Desktop.
Nginx proxy
# This looks like a infinite loop but it proxy requests sent
# to the 'old' webserver during dns propagation to the new one.
# Make sure the webserver with this code knows the updated
# IP for the domain by adding a record to /etc/hosts
server {
listen 80;
server_name domain.com;
location / {
proxy_pass http://domain.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment