From c4a6e71260ada2e07e85547bc6a005e962bb2475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Wypch=C5=82o?= Date: Mon, 18 Jan 2021 12:33:17 +0100 Subject: [PATCH] reduce directory tree nesting size (#583) --- docker/nginx/conf.d/client.conf | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index a10220a1..db69542f 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -275,21 +275,20 @@ server { proxy_set_header Expect $http_expect; proxy_set_header User-Agent: Sia-Agent; - # Extract 3 sets of 2 characters from $request_id and assign to $dir1, $dir2, $dir3 - # respectfully. The rest of the $request_id is going to be assigned to $dir4. + # Extract 2 sets of 2 characters from $request_id and assign to $dir1, $dir2 + # respectfully. The rest of the $request_id is going to be assigned to $dir3. # We use those variables to automatically generate a unique path for the uploaded file. # This ensures that not all uploaded files end up in the same directory, which is something # that causes performance issues in the renter. - # Example path result: /af/24/9b/c5ec894920ccc45634dc9a8065 - if ($request_id ~* "(\w{2})(\w{2})(\w{2})(\w+)") { + # Example path result: /af/24/9bc5ec894920ccc45634dc9a8065 + if ($request_id ~* "(\w{2})(\w{2})(\w+)") { set $dir1 $1; set $dir2 $2; set $dir3 $3; - set $dir4 $4; } # proxy this call to siad endpoint (make sure the ip is correct) - proxy_pass http://siad/skynet/skyfile/$dir1/$dir2/$dir3/$dir4$is_args$args; + proxy_pass http://siad/skynet/skyfile/$dir1/$dir2/$dir3$is_args$args; } location ~ "^/(([a-zA-Z0-9-_]{46}|[a-z0-9]{55})(/.*)?)$" {