I'm having issues with getting a simple config to work with nginx. I have a server that host docker containers so nginx is in a container. So lets call the url foo.com. I would like for the url foo.com/service1 to actually just go to foo.com on another port, so it would actually be pulling foo.com:4321 and foo.com/service2 to be pulling foo.com:5432 and so on. Here is the config I have been having issues with.
http { server { listen 0.0.0.0:80; location /service1/ { proxy_pass http://192.168.0.2:4321/; } location /service2/ { proxy_pass http://192.168.0.2:5432/; } } } So the services and nginx live at 192.168.0.2. What is the prefered way to be able to do this? Thank you in advance!
As A side note, this is running in a docker container. Thanks!
http://192.168.0.2:4321/andhttp://192.168.0.2:5432/on the host server?http://192.168.0.2:4321/andhttp://192.168.0.2:5432/?