how to diagnose 404 not found error nginx on docker? how to diagnose 404 not found error nginx on docker? nginx nginx

how to diagnose 404 not found error nginx on docker?


Guessing your nginx is not located in the workspace container, it resides on a separate container, You've executed the following: docker-compose up -d nginx mysql

That would probably only run nginx and mysql containers, not your php-fpm container. Also the path to you volume is important as the configurations in you nginx server depends on this.

To run php-fpm, add php-fpm or something similar to the docker-compose up command, check out what this is called in your docker-compose.yaml file e.g
docker-compose up -d nginx mysql phpfpm

To assess you nginx container first of all execute

 `docker ps -a`

From the list, look for the ID of your nginx container, before running

docker exec -it <container-id> bash

This should then give you assess to your nginx container to make the required changes.

Or without directly accessing the container, simply make changes in the nginx configuration file, look for 'server' and the 'root' change the root from var/www/laravel/public to the new directory /project01/public.

Execute the command to bring down your containers

docker-composer down

Star over again with

docker-compose up -d nginx mysql phpfpm 

Give it a go