title: Can't access docker container on port 80 on OSX
body: <p>In my current job we have development environment made with docker-compose.
  One container is nginx, which provide routing to other containers.
  Everything seems fine and work to my colleague on windows and osx. But on my system (osx El Capitan), there is problem with accessing nginx container on port 80.</p>
  
  <p>There is setup of container from docker-compose.yml</p>
  
  <pre><code>nginx:
      build: ./dockerbuild/nginx
      ports:
          - 80:80
      links:
          - php
      volumes_from:
          - app
  ... and more
  </code></pre>
  
  <p>In <code>./dockerbuild/nginx</code> there is nothing special, just nginx config as we know it from everywhere.</p>
  
  <p>When I run everyting with <code>docker-compose create</code> and <code>docker-compose start</code>. Then <code>docker ps</code> give me </p>
  
  <pre><code>3b296c1e4775        docker_nginx           "nginx -g 'daemon off"   About an hour ago   Up 47 minutes       0.0.0.0:80-&gt;80/tcp, 443/tcp        docker_nginx_1
  </code></pre>
  
  <p>But when I try to access it for example via curl I get error. <code>curl: (7) Failed to connect to localhost port 80: Connection refused</code></p>
  
  <p>I try to run container with port 81 and everything works fine.</p>
  
  <p>Port is really binded to docker</p>
  
  <pre><code>22:47 $ sudo lsof -i -n -P | grep TCP
  ...
  com.docke 14718         schovi   38u  IPv4 0x6e9c93c51ec4b617      0t0    TCP *:80 (LISTEN)
  ...
  </code></pre>
  
  <p>Firewall in osx is turned off and I have no other security.</p>