File tree 2 files changed +8
-5
lines changed
common/etc/nginx/templates
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,13 @@ server {
30
30
# information that could be used to find an exploit.
31
31
server_tokens off;
32
32
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
+
33
40
# Uncomment this for a HTTP header that will let you know the cache status
34
41
# of an object.
35
42
# add_header X-Cache-Status $upstream_cache_status;
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ assertHttpRequestEquals "HEAD" "a.txt?some=param&that=should&be=stripped#aaah" "
153
153
assertHttpRequestEquals " HEAD" " b/c/d.txt" " 200"
154
154
assertHttpRequestEquals " HEAD" " b/c/../e.txt" " 200"
155
155
assertHttpRequestEquals " HEAD" " b/e.txt" " 200"
156
- assertHttpRequestEquals " HEAD" " b//e.txt" " 200 "
156
+ assertHttpRequestEquals " HEAD" " b//e.txt" " 302 "
157
157
assertHttpRequestEquals " HEAD" " a/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.txt" " 200"
158
158
159
159
# We try to request URLs that are properly encoded as well as URLs that
220
220
assertHttpRequestEquals " HEAD" " b/" " 404"
221
221
assertHttpRequestEquals " HEAD" " /b/c/" " 404"
222
222
assertHttpRequestEquals " HEAD" " /soap" " 404"
223
- if [ " ${append_slash} " == " 1" ] && [ " ${index_page} " == " 0" ]; then
224
223
assertHttpRequestEquals " HEAD" " b//c" " 302"
225
- else
226
- assertHttpRequestEquals " HEAD" " b//c" " 404"
227
- fi
228
224
229
225
if [ " ${index_page} " == " 1" ]; then
230
226
assertHttpRequestEquals " HEAD" " /statichost/" " 200"
You can’t perform that action at this time.
0 commit comments