Skip to content

Commit bce19e6

Browse files
committed
fix: Normalize location path to avoid multiple forward slashes
Fixes: nginx#88
1 parent c7db9c9 commit bce19e6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

common/etc/nginx/templates/default.conf.template

+7
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ server {
3030
# information that could be used to find an exploit.
3131
server_tokens off;
3232

33+
# Normalize location path. Remove instances of double/multipe forward slashes.
34+
# Disabling merge_slashes is necessary for this feature to work.
35+
# Disabling port redirection to avoid broken URLs in bridged hosts
36+
port_in_redirect off;
37+
merge_slashes off;
38+
rewrite (.*?)//+(.*) $1/$2 redirect;
39+
3340
# Uncomment this for a HTTP header that will let you know the cache status
3441
# of an object.
3542
# add_header X-Cache-Status $upstream_cache_status;

0 commit comments

Comments
 (0)