title: Docker - Running nginx as a proxy for Redmine
body: <p>I'd like to Dockerize the setup for an nginx to redmine (and other services) reverse proxy, but when forwarding requests from nginx to redmine, I'm seeing a 501 bad gateway request on browsers and a <code>"failed (111 Connection refused)"</code> on the nginx output.</p>
  
  <p>The nginx configuration works with regular nginx server (non-dockerized) forwarding requests to a dockerized redmine server, which leads me to believe I've done something screwy with the network. I can also access the the redmine server directly via port 3000.</p>
  
  <p>Here's a snippet of my setup:</p>
  
  <p>nginx.conf</p>
  
  <pre><code>http {
      server {
          listen 80;
  
          # Seeing a 501 Bad Gateway on the browser
          location /redmine {
              proxy_pass http://127.0.0.1:3000;
          }
      }
  }
  </code></pre>
  
  <p>docker-compose.yaml</p>
  
  <pre><code>version: '2'
  services:
      nginx:
          image: nginx
          ports:
              - "80:80"
          volumes:
              - ./nginx/nginx.conf:/etc/nginx/nginx.conf
          networks:
              - shared_internal
      redmine:
          image: redmine
          ports:
              - "3000:3000"
          networks:
              - shared_internal
  networks:
      shared_internal:
  </code></pre>