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. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fo3DiRRpmz2DXjD7Uzhc8u
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@ server {
|
|||||||
add_header Referrer-Policy "same-origin" always;
|
add_header Referrer-Policy "same-origin" always;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.php$is_args$args;
|
try_files $uri /index.php$is_args$args;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
|
|||||||
Reference in New Issue
Block a user