M
M
Messi2020-02-27 12:00:41
Nginx
Messi, 2020-02-27 12:00:41

Why is Nginx not showing the start page?

Hello! There is OSX and Docker.
1. docker-compose.yml

version: '3.5'
services:
  web:
    image: nginx:stable
    ports:
      - "8010:80"

2. I do docker-compose up -d
3. I open localhost:8010
I get a long wait, no response, and as a result ERR_EMPTY_RESPONSE.

Why does it come out like this and how do I get the standard "Welcome To Nginx" response?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2020-02-27
@q2digger

I tried, for example, the behavior is not like that for me. The system is catalina.

~  docker run -it -p 8010:80 nginx:stable
Unable to find image 'nginx:stable' locally
stable: Pulling from library/nginx
68ced04f60ab: Pull complete
e6edbc456071: Pull complete
9f915b082e59: Pull complete
Digest: sha256:bfb2cb1b47766fc424a7826d5ae79dc3aa70a8bbb697de7e683b965d47eb4295
Status: Downloaded newer image for nginx:stable
172.17.0.1 - - [27/Feb/2020:09:02:52 +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987."
2020/02/27 09:02:52 [error] 8#8: *1 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 172.17.0.1, server: localhost, request: "GET /favico"
172.17.0.1 - - [27/Feb/2020:09:02:52 +0000] "GET /favicon.ico HTTP/1.1" 404 555 "http://localhost:8010/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTM"
 ~  ping localhost
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.045 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.102 ms
^C
--- localhost ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.045/0.073/0.102/0.029 ms

after launch, what's in the container logs?

S
Sergey Ryzhkin, 2020-02-27
@Franciz

Have you tried swapping ports? Well, or maybe in the assembly itself, nginx is trite not hanging on the 80th port, look at the config.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question