Skip to content

Instantly share code, notes, and snippets.

@wlaurance
Created May 5, 2014 19:22
Show Gist options
  • Save wlaurance/ca642fe33093b1a58b05 to your computer and use it in GitHub Desktop.
Save wlaurance/ca642fe33093b1a58b05 to your computer and use it in GitHub Desktop.
Nginx server snippet
server{
server_name examplehost1.com;
rewrite ^/(.*) http://www.examplehost1.com permanent;
}
server{
server_name blog.examplehost1.com;
rewrite ^/(.*) http://www.examplehost1.com permanent;
}
server{
server_name www.examplehost1.com;
location / {
proxy_pass http://127.0.0.1:3000;
}
}
server{
server_name www.examplehost2.com;
location / {
proxy_pass http://127.0.0.1:3001;
}
}
server{
server_name examplehost2.com;
rewrite ^/(.*) http://www.examplehost2.com permanent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment