How to view docker nginx container through domain name?
As the question states I would like for when users browse to my domain name they see my nginx container. Currently I can view the container (default nginx) when I browse to my droplets ip but not through the domain name. I know my domain name is pointing to my droplet correctly since performing tracerts/pings result in a connection to my droplets ip.
My setup has been this:
- launch ubuntu droplet
- install docker
- pull nginx image and run it with -p 80:80
runing docker ps results in:
a7d45cc55a85 nginx “nginx -g ‘daemon of…” 8 minutes ago Up 8 minutes 0.0.0.0:80->80/tcp
This has resulted in the display of the 'Welcome to nginx’ page when I browse to my server ip, but when I browse to my domain I get ERRCONNECTIONREFUSED, “This site can’t be reached”.
Any help would be much appreciated.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×