I have a few apps running from the same server on different ports, I want to host them on different subdomains, I'm using Nginx, I can get it to work with 1 app, but once I add a second server block both of them get a "connection time out" page in my browser this is what I'm using right now:
server {
listen 80;
server_name sub.domain.com;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8082;
proxy_redirect off;
}
}
this works, but If I add another one, both of them stop working.
When I have both it is like this:
server {
listen 80;
server_name sub.domain.com;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8082;
proxy_redirect off;
}
}
server {
listen 80;
server_name sub2.domain.com;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8083;
proxy_redirect off;
}
}