From ac3bff93510b844764b30d162e05c903f04c31e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Gra=CC=88fenstein?= Date: Sun, 22 Mar 2026 17:49:45 +0100 Subject: [PATCH] fix nginx to fall through to PHP for dynamic assets like theming CSS Static file locations were returning hard 404s instead of falling through to PHP, which broke dynamically generated assets like theming CSS files. --- nextcloud/nginx.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nextcloud/nginx.conf b/nextcloud/nginx.conf index 14d77f3..f5aa800 100644 --- a/nextcloud/nginx.conf +++ b/nextcloud/nginx.conf @@ -34,15 +34,15 @@ server { location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; } location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; } - # Serve static files directly — only if file exists on disk + # Serve static files directly, fall through to PHP for dynamic assets (e.g. theming) location ~ \.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map|ogg|flac)$ { - try_files $uri =404; + try_files $uri /index.php$request_uri; expires 6M; access_log off; } location ~ \.woff2?$ { - try_files $uri =404; + try_files $uri /index.php$request_uri; expires 7d; access_log off; }