From 500a7d3fa9c008a2b75d0f6bec519e41fed97da0 Mon Sep 17 00:00:00 2001 From: Gofannon <17145502+Gofannon@users.noreply.github.com> Date: Wed, 22 Apr 2020 22:37:42 +0200 Subject: [PATCH] [fix] dedicated named location per $app (#63) * Url rewriting (#54) * Remove unused code * Add rewrite URL functionnality * Fix subpath handling * Fix nginx error nginx: [emerg] named location "@dokuwiki" can be on the server level only in /etc/nginx/conf.d/sub.example.org.d/dokuwiki.conf:20 * [enh] Enforce URL rewrite * Increment package version * [fix] dedicated named location per $app (#61) fix multiple install on subdomains Before this fix app1 => @dokuwiki works app2 => @dokuwiki fails After \o/ app1 => @app1 works app2 => @app2 works Co-authored-by: Maniack Crudelis --- conf/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 67b1f32..64fc3ba 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -19,7 +19,7 @@ location __PATH__/ { # Common parameter to increase upload size limit in conjuction with dedicated php-fpm file client_max_body_size 25M; - try_files $uri $uri/ @dokuwiki; + try_files $uri $uri/ @__NAME__ ; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; @@ -53,7 +53,7 @@ location __PATH__/ { } # rewrites "doku.php/" out of the URLs if you set the userwrite setting to .htaccess in dokuwiki confi$ -location @dokuwiki { +location @__NAME__ { rewrite ^__PATH__/_media/(.*) __PATH__/lib/exe/fetch.php?media=$1 last; rewrite ^__PATH__/_detail/(.*) __PATH__/lib/exe/detail.php?media=$1 last; rewrite ^__PATH__/_export/([^/]+)/(.*) __PATH__/doku.php?do=export_$1&id=$2 last;