From cbe6e044c127a4a3f2bdcf4fd9864768ea448248 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 19 Apr 2020 19:37:20 +0200 Subject: [PATCH] Upgrade nginx configuration --- conf/nginx.conf | 20 +++++++++----------- conf/php-fpm.conf | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index f5e8855..d698030 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,35 +1,33 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +root __FINALPATH__/public/ ; + location __PATH__/ { # Path to source - alias __FINALPATH__/public/; - + # alias __FINALPATH__/public/ ; + # Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - index index.php index.htm index.html; + index index.php; # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file #client_max_body_size 50M; - try_files $uri $uri/ @kimai; - location ~ \.php { + try_files $uri $uri/ /index.php$is_args$args; + location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php7.3-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param REMOTE_USER $remote_user; + fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $request_filename; } # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } - -location @kimai { - rewrite /(.*)$ /index.php?/$1 last; -} diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 9d360d2..db3ac1d 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -358,7 +358,7 @@ request_terminate_timeout = 1d ; Chdir to this directory at the start. ; Note: relative path can be used. ; Default Value: current directory or / when chroot -chdir = __FINALPATH__ +chdir = __FINALPATH__/public ; Redirect worker stdout and stderr into main error log. If not set, stdout and ; stderr will be redirected to /dev/null according to FastCGI specs.