summaryrefslogtreecommitdiff
path: root/nginx
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2022-01-03 06:44:39 -0500
committerDaniel Micay <danielmicay@gmail.com>2022-01-03 06:46:30 -0500
commit53e792cffa8a2a257d11b8620a8de18e5f469cb9 (patch)
tree310307d803b4d974939cbdd5cd448fe8f183e2ac /nginx
parent3ba900b8b63d75b1d7786258e35770c3bb7e904e (diff)
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.
Diffstat (limited to 'nginx')
-rw-r--r--nginx/nginx.conf4
1 files 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 = /, {