From ceb60ef76b0e3bb236849a926dffcd745951b31c Mon Sep 17 00:00:00 2001 From: Calvin Li <65045619+calvin-li-developer@users.noreply.github.com> Date: Fri, 22 Dec 2023 09:39:56 -0500 Subject: [PATCH 1/5] sync with upstream nextcloud docs. closes #391 --- .../nginx/site-confs/default.conf.sample | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/root/defaults/nginx/site-confs/default.conf.sample b/root/defaults/nginx/site-confs/default.conf.sample index bbf8389..6bfea37 100644 --- a/root/defaults/nginx/site-confs/default.conf.sample +++ b/root/defaults/nginx/site-confs/default.conf.sample @@ -1,4 +1,10 @@ ## Version 2023/06/23 - Changelog: https://github.com/linuxserver/docker-nextcloud/commits/master/root/defaults/nginx/site-confs/default.conf.sample +## Version 2023/12/22 - Changelog: https://github.com/linuxserver/docker-nextcloud/commits/master/root/defaults/nginx/site-confs/default.conf.sample + +upstream php-handler { + server 127.0.0.1:9000; + #server unix:/run/php/php8.2-fpm.sock; +} # Set the `immutable` cache control options only for assets with a cache busting `v` argument map $arg_v $asset_immutable { @@ -59,6 +65,15 @@ server { # Remove X-Powered-By, which is an information leak fastcgi_hide_header X-Powered-By; + # Add .mjs as a file extension for javascript + # Either include it in the default mime.types list + # or include you can include that list explicitly and add the file extension + # only for Nextcloud like below: + include mime.types; + types { + text/javascript js mjs; + } + # Specify how to handle directories -- specifying `/index.php$request_uri` # here as the fallback means that Nginx always exhibits the desired behaviour # when a client requests a path that corresponds to a directory that exists @@ -126,7 +141,7 @@ server { fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice fastcgi_param front_controller_active true; # Enable pretty urls - fastcgi_pass 127.0.0.1:9000; + fastcgi_pass php-handler; fastcgi_intercept_errors on; fastcgi_request_buffering off; @@ -134,7 +149,7 @@ server { fastcgi_max_temp_file_size 0; } - location ~ \.(?:css|js|svg|gif|png|jpg|ico|wasm|tflite|map)$ { + location ~ \.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map|ogg|flac)$ { try_files $uri /index.php$request_uri; add_header Cache-Control "public, max-age=15778463, $asset_immutable"; access_log off; # Optional: Don't log access to assets From fa511a6f7bc608b12b22d9bbf9f521a1be74a396 Mon Sep 17 00:00:00 2001 From: Calvin Li <65045619+calvin-li-developer@users.noreply.github.com> Date: Fri, 22 Dec 2023 09:45:45 -0500 Subject: [PATCH 2/5] Update readme-vars.yml --- readme-vars.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/readme-vars.yml b/readme-vars.yml index b4fbcf1..511579c 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -79,6 +79,7 @@ app_setup_block: | # changelog changelogs: + - { date: "22.12.23:", desc: "Nginx conf updating default mime.types to include js and mjs and update location to include more file types." } - { date: "28.10.23:", desc: "Disable web upgrades using occ during init." } - { date: "31.08.23:", desc: "Re-add updatenotification app. This allows users to be notified for app updates, but also notifies for NextCloud updates. Updating NextCloud via the web UI is not supported when using this image." } - { date: "14.08.23:", desc: "Add develop branch." } From 1a559c989305f1c8658b7234019133d9f557ca03 Mon Sep 17 00:00:00 2001 From: Calvin Li <65045619+calvin-li-developer@users.noreply.github.com> Date: Fri, 22 Dec 2023 09:49:06 -0500 Subject: [PATCH 3/5] Update readme-vars.yml --- readme-vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme-vars.yml b/readme-vars.yml index 511579c..f45d0dd 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -79,7 +79,7 @@ app_setup_block: | # changelog changelogs: - - { date: "22.12.23:", desc: "Nginx conf updating default mime.types to include js and mjs and update location to include more file types." } + - { date: "22.12.23:", desc: "Site default conf updating default mime.types to include js and mjs and update location to include more file types." } - { date: "28.10.23:", desc: "Disable web upgrades using occ during init." } - { date: "31.08.23:", desc: "Re-add updatenotification app. This allows users to be notified for app updates, but also notifies for NextCloud updates. Updating NextCloud via the web UI is not supported when using this image." } - { date: "14.08.23:", desc: "Add develop branch." } From 5abf9b3d36c2a6d01e9f202da98eee818d76defc Mon Sep 17 00:00:00 2001 From: Calvin Li <65045619+calvin-li-developer@users.noreply.github.com> Date: Fri, 22 Dec 2023 09:54:33 -0500 Subject: [PATCH 4/5] Update readme-vars.yml --- readme-vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme-vars.yml b/readme-vars.yml index f45d0dd..fc42d84 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -79,7 +79,7 @@ app_setup_block: | # changelog changelogs: - - { date: "22.12.23:", desc: "Site default conf updating default mime.types to include js and mjs and update location to include more file types." } + - { date: "22.12.23:", desc: "Site default conf updating to include mime.types for js and mjs and update location to include more file types." } - { date: "28.10.23:", desc: "Disable web upgrades using occ during init." } - { date: "31.08.23:", desc: "Re-add updatenotification app. This allows users to be notified for app updates, but also notifies for NextCloud updates. Updating NextCloud via the web UI is not supported when using this image." } - { date: "14.08.23:", desc: "Add develop branch." } From 07a04516b1667d2c879ae581663d73b79b25a65e Mon Sep 17 00:00:00 2001 From: Calvin Li <65045619+calvin-li-developer@users.noreply.github.com> Date: Fri, 22 Dec 2023 10:34:32 -0500 Subject: [PATCH 5/5] revert fastcgi_pass/php-handler change --- root/defaults/nginx/site-confs/default.conf.sample | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/root/defaults/nginx/site-confs/default.conf.sample b/root/defaults/nginx/site-confs/default.conf.sample index 6bfea37..669a90b 100644 --- a/root/defaults/nginx/site-confs/default.conf.sample +++ b/root/defaults/nginx/site-confs/default.conf.sample @@ -1,11 +1,6 @@ ## Version 2023/06/23 - Changelog: https://github.com/linuxserver/docker-nextcloud/commits/master/root/defaults/nginx/site-confs/default.conf.sample ## Version 2023/12/22 - Changelog: https://github.com/linuxserver/docker-nextcloud/commits/master/root/defaults/nginx/site-confs/default.conf.sample -upstream php-handler { - server 127.0.0.1:9000; - #server unix:/run/php/php8.2-fpm.sock; -} - # Set the `immutable` cache control options only for assets with a cache busting `v` argument map $arg_v $asset_immutable { "" ""; @@ -141,7 +136,7 @@ server { fastcgi_param modHeadersAvailable true; # Avoid sending the security headers twice fastcgi_param front_controller_active true; # Enable pretty urls - fastcgi_pass php-handler; + fastcgi_pass 127.0.0.1:9000; fastcgi_intercept_errors on; fastcgi_request_buffering off;