From d59b6d889b8b2b2c5ae60975d0c996678aa31d51 Mon Sep 17 00:00:00 2001 From: Dillard Blom Date: Sat, 11 Jul 2026 16:37:36 +0200 Subject: [PATCH] Fix nginx 403 on root path when index.php isn't baked into the nginx image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit try_files' $uri/ fallback matched the container's document root as an existing directory and tried to serve a local directory index, but Dockerfile.nginx only copies static assets (not index.php) into the nginx image — index.php only exists in the php-fpm container. Without autoindex, nginx returned 403 for any request to "/". Dropping $uri/ lets it fall straight through to the front-controller fastcgi catch-all. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Fo3DiRRpmz2DXjD7Uzhc8u --- nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index f56e384..9edd212 100644 --- a/nginx.conf +++ b/nginx.conf @@ -11,7 +11,7 @@ server { add_header Referrer-Policy "same-origin" always; location / { - try_files $uri $uri/ /index.php$is_args$args; + try_files $uri /index.php$is_args$args; } location ~ \.php$ {