Docker compose Nginx inner container returns a 404 when its accessed through an outer container

  angular, cypress, docker, nginx

I have a docker compose with a few services interconnected, i.e. front-end, back-end and a DB.

My intention is to run a set of end to end tests in a separate container using cypress pointing to the front-end that is running in the docker compose. For this, I run the outer container in the same network as the front-end i.e. mynetwork.

docker run --network="mynetwork" e2e:latest /bin/bash -c "node_modules/cypress/bin/cypress run"

The problem I’m having is that cypress shows a Nginx 404 error in the browser when it tries to connect to http://front-end:80. It seems like it can properly reach the service but for some reason Nginx is showing 404 Not Found nginx/1.14.2.

404 Not Found – nginx/1.14.2

Source: Docker Questions