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.
twovests OP wrote
Oh yes this is exactly it!!! Thank you!
https://timothy-quinn.com/using-nginx-as-a-reverse-proxy-for-multiple-sites/
"Reverse proxy" seems to be very popular for using Apache with Nginx as well.
twovests OP wrote
Update: Nginx sucx and Caddy is the way to go B)
twovests OP wrote
Oh yes this is exactly it!!! Thank you!
https://timothy-quinn.com/using-nginx-as-a-reverse-proxy-for-multiple-sites/
"Reverse proxy" seems to be very popular for using Apache with Nginx as well.
Viewing a single comment thread. View all comments