Here's the problem:
The host machine has several docker applications running on different ports, for example. App1 @ 3001, App2 @ 3002 ... 3100, etc.
Now I would like to access applications in this format http://hostname.com/app1 , http://hostname.com/app2 ..
To do this, I run nginx on the host for proxy requests to the right port based on sub-uri
location = /app1 { proxy_redirect http://hostname:3001/; include /etc/nginx/proxy_params; } location ^~ /app1 { proxy_redirect http://hostname:3001/app1; include /etc/nginx/proxy_params; }
But this will not work if the ur uri site changes or the site is redirected. For instance:
If I visit the site at hostname:3001 -> I can see the site If I visit the site at http:
Is there any way to do this? Or is the only way to do this is to install dns as app1.hostname.com and perform name-based routing?
source share