We will use Nginx to route each subdomain to a different container on the same server.
Nginx configuration
server {
listen 80;
server_name app.example.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
Reload
sudo nginx -t
sudo systemctl reload nginx
Done
Open the domain in your browser and confirm the app loads.
Comments 0
No comments yet. Be the first to comment.