title: Nginx Reverse proxy config
body: <p>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 <code>foo.com</code>. I would like for the url <code>foo.com/service1</code> to actually just go to foo.com on another port, so it would actually be pulling <code>foo.com:4321</code> and <code>foo.com/service2</code> to be pulling <code>foo.com:5432</code> and so on. Here is the config I have been having issues with.</p>
  
  <pre><code>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/;
          }
  
      }
  }
  </code></pre>
  
  <p>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!</p>
  
  <p>As A side note, this is running in a docker container. Thanks!</p>