Can't access docker container on port 80 on OSX

if you are using docker-for-mac:

Accessing by localhost:80 is correct, though you still have to ensure you do not have a local apache/nginx service running. Often leftovers from boxen/homebrew exist binding that port, because thats what developers did back then :)

if you are using dockertoolbox/virtualbox/whatever hypervisor

You will not be able to access it by localhost, by by the docker-machine ip, so write docker-machine ip default and the use http://$ip:80 in your browser

if that does not help

Ensure your nginx container actually does work, so connect to the container: docker exec -i -t <containerid> bash

and then run ps aux nginx or if telnet is installed try to connect to localhost


Solved!

Problem was, that long long time ago I installed pow (super simple automated rails server which run application on app_name.local domain). And this beast left LaunchAgent script which update pf to forward port 80 to pow port.