From 53e792cffa8a2a257d11b8620a8de18e5f469cb9 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Mon, 3 Jan 2022 06:44:39 -0500 Subject: [PATCH] improve approach to redundant slash redirection Since merge_slashes gets rid of the redundant slashes, a no-op rewrite will get rid of all of them at once instead of requiring one redirect to get rid of each redundant slash. --- nginx/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 674b2e8d..b42c3646 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -192,8 +192,8 @@ http { gzip_static on; brotli_static on; - if ($request_uri ~ (.*)//(.*)) { - return 301 $1/$2; + if ($request_uri ~ //) { + rewrite ^(.*)$ $1 permanent; } location = /, {