From d1a82ef256c08131f5c665a3f83ae76c8d71faab Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 5 Apr 2022 22:58:55 +0200 Subject: [PATCH] Fix --- conf/htconfig.sample.php | 2 +- conf/nginx.conf | 28 +++++++++++----------------- scripts/_common.sh | 4 ++-- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/conf/htconfig.sample.php b/conf/htconfig.sample.php index 955c6d8a..ab536415 100644 --- a/conf/htconfig.sample.php +++ b/conf/htconfig.sample.php @@ -17,7 +17,7 @@ $db_port = 3306; // leave 0 for default or set your port $db_user = '__DB_USER__'; $db_pass = '__DB_PWD__'; $db_data = '__DB_NAME__'; -$db_type = mysql; // use 1 for postgres, 0 for mysql +$db_type = 'mysql'; // use 1 for postgres, 0 for mysql /* * Notice: Many of the following settings will be available in the admin panel diff --git a/conf/nginx.conf b/conf/nginx.conf index f9ef9895..f3bd2757 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,4 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/ { +location / { alias __FINALPATH__/; @@ -15,13 +14,12 @@ location __PATH__/ { charset utf-8; - location ~* \.php$ - { - try_files $uri =404; - fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + location ~* \.php$ { + try_files $uri =404; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } # make sure webfinger and other well known services aren't blocked @@ -33,14 +31,10 @@ location __PATH__/ { } } - # statically serve these file types when possible - # otherwise fall back to front controller - # allow browser to cache them - # added .htm for advanced source code editor library - # location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|map|ttf|woff|woff2|svg)$ { - # expires 30d; - # try_files $uri /index.php?q=$uri&$args; - # } + location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|map|ttf|woff|woff2|svg)$ { + expires 30d; + try_files $uri /index.php; + } # block these file types location ~* \.(tpl|md|tgz|log|out)$ { diff --git a/scripts/_common.sh b/scripts/_common.sh index e75d0440..39f2be37 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,9 +5,9 @@ #================================================= # dependencies used by the app -YNH_PHP_VERSION="8.0" +YNH_PHP_VERSION="7.4" -pkg_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd" +pkg_dependencies="php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd" #================================================= # PERSONAL HELPERS