From 02493e8051056865bb52896e8c776819c2701c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 29 Jan 2023 17:18:54 +0100 Subject: [PATCH] Fix --- conf/nginx.conf | 8 +++++++- scripts/install | 5 +---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index e8d8e6d..53e4bf2 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -9,7 +9,7 @@ location __PATH__/ { # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file client_max_body_size 256M; - try_files $uri $uri/ __PATH__/index.php; + try_files $uri __PATH__/index.php$is_args$args; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; @@ -22,6 +22,12 @@ location __PATH__/ { fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^[^(\.php)]+\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ { + access_log off; + expires 1h; + add_header Cache-Control public; + } + # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } diff --git a/scripts/install b/scripts/install index b516cc1..b96bd1d 100755 --- a/scripts/install +++ b/scripts/install @@ -27,7 +27,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC -key=$(ynh_string_random --length=32) +#key=$(ynh_string_random --length=32) app=$YNH_APP_INSTANCE_NAME @@ -122,10 +122,7 @@ ynh_add_nginx_config ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="../conf/config.yml" --destination="$final_path/config/config.yml" -ynh_add_config --template="../conf/.env" --destination="$final_path/public/.env" -chmod 650 "$final_path/public/.env" -chown $app:$app "$final_path/public/.env" chmod 650 "$final_path/config/config.yml" chown $app:$app "$final_path/config/config.yml"