title: nginx proxy_pass to a linked docker container
body: <p>I have two docker containers with nginx. container1 is linked to container2. Docker then adds an entry to <em>/etc/hosts</em> which I entered into the nginx configuration like so:</p>
  
  <pre><code>server {
      location ~ ^/some_url/(.*)$ {
          proxy_pass http://container1/$1;
      }
  }
  </code></pre>
  
  <p>I can ping <em>container1</em> from <em>container2</em>, but nginx cannot resolve it:</p>
  
  <blockquote>
    <p>*1 no resolver defined to resolve container1</p>
  </blockquote>
  
  <p>How can I proxy_pass a request to another docker container?</p>