I’m running into an issue with Docker and nginx, where every request to my server is generating a 404 error with a “File not found” message.
This is my docker compose file:
services:
nginx:
build: ./nginx_docker/
ports:
- 80:80
- 443:443
volumes:
- ./www/:/var/www/html/
- ./nginx_docker/default.conf:/etc/nginx/conf.d/default.conf
php:
build: ./php_docker/
expose:
- 9000
volumes:
- ./www/:/var/www/html/
db:
image: mariadb
volumes:
- mysql-data:/var/lib/mysql
environment:
- MYSQL_DATABASE=local_db
- MYSQL_ROOT_PASSWORD=test
volumes:
mysql-data:
nginx Dockerfile:
FROM nginx
COPY ./default.conf /etc/nginx/conf.d/default.conf
php Dockerfile:
FROM php:8.2-fpm
RUN apt-get update &&
apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev &&
docker-php-ext-configure gd &&
docker-php-ext-install gd
RUN docker-php-ext-install mysqli pdo pdo_mysql
RUN docker-php-ext-enable mysqli
Any help with the config would be appreciated!