How to navigate to an index.html with nginx? This builds and runs without apparent error:
root@mordor:/home/nicholas/docker/nginx# 
root@mordor:/home/nicholas/docker/nginx# docker exec -ti some-nginx bash
root@2c912aa5ce5c:/# 
root@2c912aa5ce5c:/# ls /usr/share/nginx/html/
50x.html  index.html
root@2c912aa5ce5c:/# 
root@2c912aa5ce5c:/# cat /usr/share/nginx/html/50x.html 
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Error&lt;/title&gt;
&lt;style&gt;
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;An error occurred.&lt;/h1&gt;
&lt;p&gt;Sorry, the page you are looking for is currently unavailable.&lt;br/&gt;
Please try again later.&lt;/p&gt;
&lt;p&gt;If you are the system administrator of this resource then you should check
the error log for details.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Faithfully yours, nginx.&lt;/em&gt;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
root@2c912aa5ce5c:/# 
root@2c912aa5ce5c:/# cat /usr/share/nginx/html/index.html 



hello world

how do I put this file in a diff dir?


root@2c912aa5ce5c:/# 
root@2c912aa5ce5c:/# exit
exit
root@mordor:/home/nicholas/docker/nginx# 
root@mordor:/home/nicholas/docker/nginx# docker container ls
CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS              PORTS                  NAMES
2c912aa5ce5c        some-content-nginx   &quot;/docker-entrypoint.…&quot;   5 minutes ago       Up 5 minutes        0.0.0.0:8080-&gt;80/tcp   some-nginx
root@mordor:/home/nicholas/docker/nginx# 
root@mordor:/home/nicholas/docker/nginx# ls
dockerfile  index.html
root@mordor:/home/nicholas/docker/nginx# 
root@mordor:/home/nicholas/docker/nginx# cat dockerfile 
FROM nginx
COPY index.html /usr/share/nginx/html
root@mordor:/home/nicholas/docker/nginx# 
root@mordor:/home/nicholas/docker/nginx# cat index.html 



hello world

how 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 --dump

Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://localhost/
nicholas@mordor:~$ 
nicholas@mordor:~$ lynx localhost/index.html --dump

Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://localhost/index.html
nicholas@mordor:~$ 
nicholas@mordor:~$ lynx localhost/50x.html --dump

Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://localhost/50x.html
nicholas@mordor:~$ 

Neither am I getting a welcome file from nginx as I'd expect.
Did you only try to reach localhost? Or even 0.0.0.0 or 127.0.0.1?
Depending on the operating system, docker config and the internal networking setup, some problem can occurs to reach the docker network.
You can inspect the container to get the network IP, maybe you can go there https://stackoverflow.com/a/20686101/2904965