Skip to content

Instantly share code, notes, and snippets.

@aaira-a
Last active August 29, 2015 14:11
Show Gist options
  • Save aaira-a/514e4829235d4a886a1a to your computer and use it in GitHub Desktop.
Save aaira-a/514e4829235d4a886a1a to your computer and use it in GitHub Desktop.
redirect subdomains to different ports in nginx
server {
listen 80;
server_name sub1.domain.com;
location / {
proxy_pass http://localhost:8008;
}
}
server {
listen 80;
server_name sub2.domain.com;
location / {
proxy_pass http://localhost:8009;
}
location /static2 {
autoindex on;
alias /path/to/static/folder;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment