Y
Y
yellow_pus2022-03-02 21:58:30
Nginx
yellow_pus, 2022-03-02 21:58:30

How to check the health of an nginx container?

I decided to transfer the laravel project to docker, there is a yml file that, through build and dockerfile, refers to the nginx config. In theory, the nginx.conf file is configured correctly, but upon request in the browser to localhost:8090, it gives a "File not found" error. I had the same error a long time ago when I set up each config manually, it meant that index.php was not found. As far as I know, you can go inside the nginx container itself through the command sudo docker exec -it <название_контейнера> bashand check if the config itself is configured correctly (in particular, whether it finds index.php). I went inside the container, but what command can do the check and what other useful commands exist inside the containers?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2022-03-02
@karabanov

Did everything right. Check that the directory that is specified as root in the Nginx config really exists and that there are files in it.
Otherwise, inside the container, you can execute the same commands as in the host system, unless of course all the necessary packages have been added to the image. Meanwhile, if something is missing, then you can assemble your image with all the necessary software.
As a rule, utilities like cat, ls are available.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question