Skip to content

Instantly share code, notes, and snippets.

@mashiro
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save mashiro/9227268 to your computer and use it in GitHub Desktop.

Select an option

Save mashiro/9227268 to your computer and use it in GitHub Desktop.
server {
listen 80;
# my.example.com.127.0.0.1.xip.io;
server_name "~^.*?([^.]+\.[^.]+)\.((?:\d{1,3}\.){3}\d{1,3})\.xip\.io$";
location / {
proxy_set_header host $host;
proxy_set_header x-real-ip $remote_addr;
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
proxy_pass http://$1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment