Nginx doesn’t support sub-domains on IP address that you have used and resolving that we need to modify the client's host but in question, you have already mentioned that you don't want to change it(client’s host).
For this problem, we have one more solution (ie:-you can set nginx to redirect) for that you need to follow these commands.
location /Jenkins {
proxy_pass http://jenkins:8080;
...
}
location /other-container {
proxy_pass http://other-container:8080;
}
It would allow you to your IP address (ie:-192.168.1.2/jenkins)
One more way to achieve access by serving the containers through different ports, for that you need to follow this docker file so that you will get easily.
server {
listen 8081;
location / {
proxy_pass http://jenkins:8080;
...
}
server {
listen 8082;
location / {
proxy_pass http://other-container:8080;
...
}
After building this dockerfile you can access through port -81.
Thus, this is the way to configure Nginx to access hosted services through a subdomain of your server. And services and Nginx are instantiated with Docker-compose.