Impossible to access localhost:port

i tried to launch by docker-compose up -d my app (1 frontend, 1 backend and a reverse proxy) the containers are ok and running but after a curl -v localhost:8091, it returns : * Trying…

  • Connected to localhost ( port 8091 (#0)

GET / HTTP/1.1
Host: localhost:8091
User-Agent: curl/7.81.0
Accept: /

  • Mark bundle as not supporting multiuse
    < HTTP/1.1 404 Not Found
    < Server: nginx/1.25.1
    < Date: Mon, 24 Jul 2023 16:00:31 GMT
    < Content-Type: text/html
    < Content-Length: 153
    < Connection: keep-alive
404 Not Found

404 Not Found

nginx/1.25.1 * Connection #0 to host localhost left intact. of course i tried to change my nginx.conf to check issue of redirection but always the pb. I need your expertise on the subject, of course i can give you all that you need to analyse it because the issue is probably due to a bad configuration but it is necessary to check point by point because of the multiple cause of the pb. thanks a lot.

Though, you do understand that 404 is a response of the nginx container, don’t you?

If the published host port would not be connected to the container port, you would get a plain connetion refused, instead of the http error you receive.

You need to make sure that something exists in the nginx container for the context path you try to access.
So yes, it is high likely that something is incorrect in the configuration.

I fixed the issue, actually, it was a bad naming of container in my configuration making it not operational docker dns.