Docker Community Forums

Share and learn in the Docker community.

Access docker web-server container via hostname

I have run official nginx container (or apache, same issue) and set up web server to listen virtual host (for example, with name “vhost”). I’ve also added entry in “C:\Windows\System32\drivers\etc\host” file: “ vhost” (I’ve tried “ vhost”, same issue).

Now I can access container on browser at “http://localhost”, but I can’t access it at “http://vhost”. My project depends on hostnames. What have I done wrong?