From 8ea56a786e1c3e0028a021cc2e5638fc3ca5439e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 8 May 2023 19:19:03 +0200 Subject: [PATCH] Update nginx.conf --- conf/nginx.conf | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 6423ceb..356ae5f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,14 +6,15 @@ location __PATH__/ { index index.php; - rewrite ^/?$ /index.php?act=dashboard.show; - rewrite ^/([^/\.]+)/?$ /index.php?act=$1; - rewrite ^/([^/\.]+)/([^/\.]+)/?$ /index.php?act=$1.$2; - rewrite ^/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ /index.php?act=$1.$2&id=$3; + rewrite ^__PATH__/leantime(/.*)$ __PATH__$1 permanent; + rewrite ^__PATH__/?$ __PATH__/index.php?act=dashboard.show last; + rewrite ^__PATH__/([^/\.]+)/([^/\.]+)/?$ __PATH__/index.php?act=$1.$2 last; + rewrite ^__PATH__/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ __PATH__/index.php?act=$1.$2&id=$3 last; + rewrite ^__PATH__(/.*)$ $1 break; client_max_body_size 50M; - #try_files $uri $uri/ /index.php; + #try_files $uri $uri/ __PATH__/index.php; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; @@ -25,7 +26,29 @@ location __PATH__/ { 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 = __PATH__/resetPassword { + rewrite ^(.*)$ __PATH__/index.php?resetPassword=true; + } + location = __PATH__/install { + rewrite ^(.*)$ __PATH__/index.php?install=true; + } + location = __PATH__/update { + rewrite ^(.*)$ __PATH__/index.php?update=true; + } + # assets, media + location ~* \.(?:css(\.map)?|js(\.map)?|jpe?g|png|gif|ico|cur|heic|webp|tiff?|mp3|m4a|aac|ogg|midi?|wav|mp4|mov|webm|mpe?g|avi|ogv|flv|wmv)$ { + rewrite ^__PATH__/leantime(/.*)$ __PATH__$1 permanent; + rewrite ^__PATH__(/.*)$ $1 break; + expires 7d; + access_log off; + } + # svg, fonts + location ~* \.(?:svgz?|ttf|ttc|otf|eot|woff2?)$ { + rewrite ^__PATH__/leantime(/.*)$ __PATH__$1 permanent; + rewrite ^__PATH__(/.*)$ $1 break; + add_header Access-Control-Allow-Origin "*"; + expires 7d; + access_log off; + }