Viewing a single comment thread. View all comments

3

bunnies wrote

I think you can configure nginx to do proxying based on the HTTP Host header. You'd have each service listen to a different port on the loopback interface, and then do something like this in the nginx config:

server {
    listen       80;
    server_name  mastodon.mysite.xyz;

    location / {
        proxy_pass   http://127.0.0.1:3000;
    }
}
server {
    listen       80;
    server_name  blog.mysite.xyz;

    location / {
        proxy_pass   http://127.0.0.1:3001;
    }
}
server {
    listen       80;
    server_name  cloud.mysite.xyz;

    location / {
        proxy_pass   http://127.0.0.1:3002;
    }
}

For https, you would have to set that up in nginx, since it needs the decrypted request in order to know where to forward it to.