nginx - How to configure /etc/hosts to test local Docker setup -


i'm trying develop web app locally using native docker os x (beta) handle entire environment.

in order fake production dns configuration (to test nginx setup) have edited host file (at /private/etc/hosts):

## # host database # # localhost used configure loopback interface # when system booting.  not change entry. ## 127.0.0.1       localhost 255.255.255.255 broadcasthost ::1             localhost  # added me 0.0.0.0         www.mydomain.com 

the nginx config file tested , working on production server.

expected behaviour: when point browser www.mydomain.com should redirected ip 0.0.0.0 (dockers default ip on osx), , containerized web app should appear.

actual behaviour: browser shows "failed open page" error message.

what missing here?

you docker-for-mac ip ist not 0.0.0.0 - nothing has ip. use 127.0.0.1 if using docker-for-mac.

also ensure, when start docker, export ports host, either docker-compose or docker run adding -p 80:80 when starting web-container


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -