From 44690638f987d01d9b768eb51c26550a4d1cc0bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 2 Jun 2023 08:36:00 +0200 Subject: [PATCH 1/6] synchronize with upstream --- conf/nginx.conf | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index c128273..c47c6d7 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -77,7 +77,7 @@ location ^~ __PATH__/ { # Rules borrowed from `.htaccess` to hide certain paths from clients location ~ ^__PATH__/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; } - location ~ ^__PATH__/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; } + location ~ ^__PATH__/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; } # Ensure this block, which passes PHP files to the PHP process, is above the blocks # which handle static assets (as seen below). If this block is not declared first, @@ -88,14 +88,17 @@ location ^~ __PATH__/ { # https://github.com/nextcloud/documentation/pull/2197#issuecomment-721432337 # This line fix the ldap admin page rewrite ^__PATH__/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy) __PATH__/index.php$request_uri; + fastcgi_split_path_info ^(.+?\.php)(/.*)$; set $path_info $fastcgi_path_info; + try_files $fastcgi_script_name =404; + include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param PATH_INFO $path_info; fastcgi_param HTTPS on; + fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice fastcgi_param front_controller_active true; # Enable pretty urls fastcgi_param HTTP_ACCEPT_ENCODING ""; # Disable encoding of nextcloud response to inject ynh scripts @@ -104,10 +107,14 @@ location ^~ __PATH__/ { fastcgi_request_buffering off; } - location ~ \.(?:css|js|svg|gif)$ { + location ~ \.(?:css|js|svg|gif|png|jpg|ico|wasm|tflite|map)$ { try_files $uri / __PATH__/index.php$request_uri; - expires 6M; # Cache-Control policy borrowed from `.htaccess` + more_set_headers "Cache-Control: public, max-age=15778463, $asset_immutable"; + #expires 6M; # Cache-Control policy borrowed from `.htaccess` access_log off; # Optional: Don't log access to assets + + location ~ \.wasm$ { + default_type application/wasm; } location ~ \.woff2?$ { From 8b4c136461efa8951cfb329d63d0fd963ecbe215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 2 Jun 2023 08:38:11 +0200 Subject: [PATCH 2/6] Update nginx.conf --- conf/nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index c47c6d7..ce4b172 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -115,6 +115,7 @@ location ^~ __PATH__/ { location ~ \.wasm$ { default_type application/wasm; + } } location ~ \.woff2?$ { From 4e673e9b4c870775d43795810713238115f080a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 2 Jun 2023 08:49:13 +0200 Subject: [PATCH 3/6] Update nginx.conf --- conf/nginx.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index ce4b172..b592bc7 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -109,8 +109,7 @@ location ^~ __PATH__/ { location ~ \.(?:css|js|svg|gif|png|jpg|ico|wasm|tflite|map)$ { try_files $uri / __PATH__/index.php$request_uri; - more_set_headers "Cache-Control: public, max-age=15778463, $asset_immutable"; - #expires 6M; # Cache-Control policy borrowed from `.htaccess` + expires 6M; # Cache-Control policy borrowed from `.htaccess` access_log off; # Optional: Don't log access to assets location ~ \.wasm$ { From c9b5a1b756e976da8b00350ba7890331d9b9e041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 2 Jun 2023 08:50:39 +0200 Subject: [PATCH 4/6] Update nginx.conf --- conf/nginx.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index b592bc7..25f7f1e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -107,6 +107,12 @@ location ^~ __PATH__/ { fastcgi_request_buffering off; } + location ~ ^/(?:updater|oc[ms]-provider)(?:$|/) { + try_files $uri/ =404; + index index.php; + + } + location ~ \.(?:css|js|svg|gif|png|jpg|ico|wasm|tflite|map)$ { try_files $uri / __PATH__/index.php$request_uri; expires 6M; # Cache-Control policy borrowed from `.htaccess` From f3f6fd2f0ac14d70bcb1ef17dc5f9958afe8a297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 2 Jun 2023 08:52:21 +0200 Subject: [PATCH 5/6] Update nginx.conf --- conf/nginx.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 25f7f1e..7c9eca8 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -110,7 +110,6 @@ location ^~ __PATH__/ { location ~ ^/(?:updater|oc[ms]-provider)(?:$|/) { try_files $uri/ =404; index index.php; - } location ~ \.(?:css|js|svg|gif|png|jpg|ico|wasm|tflite|map)$ { From 987c430f3ad4dc4d32ae9a3c24022f3a8df57eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 2 Jun 2023 18:55:33 +0200 Subject: [PATCH 6/6] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 7c9eca8..fe2a394 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -114,7 +114,7 @@ location ^~ __PATH__/ { location ~ \.(?:css|js|svg|gif|png|jpg|ico|wasm|tflite|map)$ { try_files $uri / __PATH__/index.php$request_uri; - expires 6M; # Cache-Control policy borrowed from `.htaccess` + expires 6M; # Cache-Control policy borrowed from `.htaccess` access_log off; # Optional: Don't log access to assets location ~ \.wasm$ {