Route a subdomain thru nginx to docker
Set proxy for a docker service thru subdomain. Subdomain: your.domain.com Docker Port: 9999 Edit docker-compose for an app you would like to proxy to. Add 127.0.0.1:9999, mapping it to a port in docker (here it’s 3000)
|
1 2 |
ports: - "127.0.0.1:9999:3000" |
Restart
|
1 2 |
docker compose down docker compose up -d |
Create nginx config, replacing 9999 and your.domain.com to docker port and subdomain of your choice.
|
1 |
sudo vim /etc/nginx/sites-available/your.domain.com |
[…]
