From fdacb1b2e7ca92cccbe6bf4a013c65e74c2cd03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 21 Oct 2023 21:51:49 +0200 Subject: [PATCH] Update nginx.conf --- conf/nginx.conf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 0948834..ab6f474 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -74,7 +74,7 @@ location ^~ __PATH__/ { # that file is correctly served; if it doesn't, then the request is passed to # the front-end controller. This consistent behaviour means that we don't need # to specify custom rules for certain paths (e.g. images and other assets, - # `/updater`, `/ocm-provider`, `/ocs-provider`), and thus + # `/updater`, `/ocs-provider`), and thus # `try_files $uri $uri/ /nextcloud/index.php$request_uri` # always provides the desired behaviour. index index.php index.html __PATH__/index.php$request_uri; @@ -112,13 +112,13 @@ location ^~ __PATH__/ { try_files $fastcgi_script_name =404; include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $request_filename; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #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 + fastcgi_param HTTP_ACCEPT_ENCODING ""; # Disable encoding of Nextcloud response to inject ynh scripts fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_intercept_errors on; fastcgi_request_buffering off; @@ -137,9 +137,10 @@ location ^~ __PATH__/ { index index.php; } + # Serve static files location ~ \.(?:css|js|mjs|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"; access_log off; # Optional: Don't log access to assets location ~ \.wasm$ {