From f04ae146a0a2ea3c3223670ff790402d75cf4246 Mon Sep 17 00:00:00 2001 From: Christian Steinle Date: Wed, 13 Nov 2024 09:32:51 +0000 Subject: [PATCH] Apply new version configuration. --- nextcloud/nextcloud.conf | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/nextcloud/nextcloud.conf b/nextcloud/nextcloud.conf index ea93af3..df42447 100644 --- a/nextcloud/nextcloud.conf +++ b/nextcloud/nextcloud.conf @@ -76,6 +76,12 @@ server { location = /.well-known/carddav { return 301 /remote.php/dav/; } location = /.well-known/caldav { return 301 /remote.php/dav/; } + location /.well-known/acme-challenge { try_files $uri $uri/ =404; } + location /.well-known/pki-validation { try_files $uri $uri/ =404; } + + location /.well-known/webfinger { return 301 /index.php/.well-known/webfinger/; } + location /.well-known/nodeinfo { return 301 /index.php/.well-known/nodeinfo; } + # Let Nextcloud's API for `/.well-known` URIs handle all other # requests by passing them to the front-end controller. return 301 /index.php$request_uri; @@ -109,10 +115,26 @@ server { fastcgi_intercept_errors on; fastcgi_request_buffering off; + + fastcgi_max_temp_file_size 0; } - location ~ \.(?:css|js|svg|gif|png|jpg|ico)$ { + # Javascript mimetype fixes for nginx + # Note: The block below should be removed, and the js|mjs section should be + # added to the block below this one. This is a temporary fix until Nginx + # upstream fixes the js mime-type + location ~* \.(?:js|mjs)$ { + types { + text/javascript js mjs; + } try_files $uri /index.php$request_uri; + add_header Cache-Control "public, max-age=15778463, immutable"; + access_log off; + } + + location ~ \.(?:css|svg|gif|png|jpg|ico|wasm|tflite|map|ogg|flac)$ { + try_files $uri /index.php$request_uri; + expires 6M; # Cache-Control policy borrowed from `.htaccess` access_log off; # Optional: Don't log access to assets }