Fix nginx 403 on root path when index.php isn't baked into the nginx image

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.
This commit is contained in:
2026-07-11 16:37:36 +02:00
parent 43504d92dc
commit 7d9ae6acd2
+1 -1
View File
@@ -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$ {