Quantcast
Channel: Active questions tagged dockerfile - DevOps Stack Exchange
Viewing all articles
Browse latest Browse all 136

How to navigate to an index.html with nginx?

$
0
0

This builds and runs without apparent error:

root@mordor:/home/nicholas/docker/nginx# root@mordor:/home/nicholas/docker/nginx# docker exec -ti some-nginx bashroot@2c912aa5ce5c:/# root@2c912aa5ce5c:/# ls /usr/share/nginx/html/50x.html  index.htmlroot@2c912aa5ce5c:/# root@2c912aa5ce5c:/# cat /usr/share/nginx/html/50x.html <!DOCTYPE html><html><head><title>Error</title><style>    body {        width: 35em;        margin: 0 auto;        font-family: Tahoma, Verdana, Arial, sans-serif;    }</style></head><body><h1>An error occurred.</h1><p>Sorry, the page you are looking for is currently unavailable.<br/>Please try again later.</p><p>If you are the system administrator of this resource then you should checkthe error log for details.</p><p><em>Faithfully yours, nginx.</em></p></body></html>root@2c912aa5ce5c:/# root@2c912aa5ce5c:/# cat /usr/share/nginx/html/index.html hello worldhow do I put this file in a diff dir?root@2c912aa5ce5c:/# root@2c912aa5ce5c:/# exitexitroot@mordor:/home/nicholas/docker/nginx# root@mordor:/home/nicholas/docker/nginx# docker container lsCONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS              PORTS                  NAMES2c912aa5ce5c        some-content-nginx   "/docker-entrypoint.…"   5 minutes ago       Up 5 minutes        0.0.0.0:8080->80/tcp   some-nginxroot@mordor:/home/nicholas/docker/nginx# root@mordor:/home/nicholas/docker/nginx# lsdockerfile  index.htmlroot@mordor:/home/nicholas/docker/nginx# root@mordor:/home/nicholas/docker/nginx# cat dockerfile FROM nginxCOPY index.html /usr/share/nginx/htmlroot@mordor:/home/nicholas/docker/nginx# root@mordor:/home/nicholas/docker/nginx# cat index.html hello worldhow do I put this file in a diff dir?root@mordor:/home/nicholas/docker/nginx# 

Yet, there's no output when browsing to localhost:

nicholas@mordor:~$ nicholas@mordor:~$ lynx localhost --dumpLooking up localhostMaking HTTP connection to localhostAlert!: Unable to connect to remote host.lynx: Can't access startfile http://localhost/nicholas@mordor:~$ nicholas@mordor:~$ lynx localhost/index.html --dumpLooking up localhostMaking HTTP connection to localhostAlert!: Unable to connect to remote host.lynx: Can't access startfile http://localhost/index.htmlnicholas@mordor:~$ nicholas@mordor:~$ lynx localhost/50x.html --dumpLooking up localhostMaking HTTP connection to localhostAlert!: Unable to connect to remote host.lynx: Can't access startfile http://localhost/50x.htmlnicholas@mordor:~$ 

Neither am I getting a welcome file from nginx as I'd expect.


Viewing all articles
Browse latest Browse all 136

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>