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] 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 bbf83899..6bfea379 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