From a0234772543d978a336aa220185094cb7e197c61 Mon Sep 17 00:00:00 2001 From: Titus PiJean Date: Fri, 16 Mar 2018 17:23:14 +0100 Subject: [PATCH] Fix alias_traversal See alias_traversal errors in https://ci-apps.yunohost.org/jenkins/job/flarum%20(Community)/4/consoleFull --- conf/nginx.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 9930daf..1ec0c01 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -location ^~ __PATH__ { +location ^~ __PATH__/ { if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; @@ -10,10 +10,10 @@ location ^~ __PATH__ { # Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 ) location __LOCATION_HACK__/ { try_files $uri $uri/ __PATH_HACK__/index.php?$query_string; } - location __LOCATION_HACK__/api { try_files $uri $uri/ __PATH_HACK__/api.php?$query_string; } - location __LOCATION_HACK__/admin { try_files $uri $uri/ __PATH_HACK__/admin.php?$query_string; } + location __LOCATION_HACK__/api/ { try_files $uri $uri/ __PATH_HACK__/api.php?$query_string; } + location __LOCATION_HACK__/admin/ { try_files $uri $uri/ __PATH_HACK__/admin.php?$query_string; } - location __LOCATION_HACK__/flarum { + location __LOCATION_HACK__/flarum/ { deny all; return 404; }