diff --git a/conf/nginx.conf b/conf/nginx.conf index 021bfe2..109e474 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -14,7 +14,8 @@ location __PATH__/ { index index.php; - try_files $uri $uri/ index.php; + try_files $uri $uri/ @rewrite___NAME__; + location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; @@ -25,8 +26,6 @@ location __PATH__/ { fastcgi_param REMOTE_USER $remote_user; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $request_filename; - - try_files $uri @rewrite; } location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { @@ -35,6 +34,11 @@ location __PATH__/ { log_not_found off; } + location = __PATH__/_.gif { + expires max; + empty_gif; + } + location ^~ __PATH__/cache/ { deny all; } @@ -46,3 +50,7 @@ location __PATH__/ { # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } + +location @rewrite___NAME__ { + rewrite ^/__PATH__/(.*)$ /__PATH__/index.php?title=$1&$args; +}