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.
This commit is contained in:
2026-03-22 17:49:45 +01:00
parent 0088c11d5e
commit ac3bff9351

View File

@@ -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;
}