nginx + php on Docker Compose generating 404 error
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.
nginx not showing index.php as default
I created a docker image to server PHP code based on nginx. Everything seems to work quite well except that my request URL always needs to contain index.php (like: http://myserver.com/inde.php). If I skip “index.php” nginx will deliver just the welcome page and not automatically use index.php.
Nginx-Traefik Reverse Proxy versus NGINX FastCGI Support
I am using docker-compose.yaml
to define the services I need for my local development. Recently, I have added a new Traefik service to benefit from Domain Name Service Resolution capabilities that Traefik offers.
NGINX php docker 403 forbidden
My default.conf file is below:
Nginx Redirecting from Localhost to localhost/index.php/. (Nginx + Php)
I have set up a docker container with php + nginx. I made a change to the nginx config so that it redirects to index.php in the root folder if it does not find any file or directory. It started looping adding /index.php/ to the url infinitely. I changed the config back to: