From 939d964275daaa7a50c913d2eab61af1bb13d9fd Mon Sep 17 00:00:00 2001 From: Wonderfall Date: Thu, 25 Mar 2021 19:55:19 +0100 Subject: [PATCH] update nginx.conf --- rootfs/nginx/sites-enabled/nginx.conf | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/rootfs/nginx/sites-enabled/nginx.conf b/rootfs/nginx/sites-enabled/nginx.conf index e7b8aa0..47470d1 100644 --- a/rootfs/nginx/sites-enabled/nginx.conf +++ b/rootfs/nginx/sites-enabled/nginx.conf @@ -41,12 +41,12 @@ server { rewrite ^ /index.php$uri; } - location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ { - deny all; + location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { + return 404; } location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { - deny all; + return 404; } location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) { @@ -67,8 +67,15 @@ server { index index.php; } - location ~ \.(?:css|js|woff2?|svg|gif|map)$ { + location ~ \.(?:css|js|svg|gif|map)$ { try_files $uri /index.php$uri$is_args$args; + expires 6M; + access_log off; + } + + location ~ \.woff2?$ { + try_files $uri /index.php$uri$is_args$args; + expires 7d; access_log off; }