From 5a8604ae8d3571c8e081ed9eb99720be6e2a0e1d Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 17 May 2020 14:55:51 +0200 Subject: [PATCH] [fix] follow nginx conf order for path traversal --- conf/nginx.conf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index e59f30c..61a3fea 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,11 +1,13 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { + # Path to source + alias __FINALPATH__/public/ ; + if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; + rewrite ^ https://$server_name$request_uri? permanent; } - alias __FINALPATH__/public/; index index.php; # Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 )