merge_slashes

Syntax: merge_slashes on | off;
Default: merge_slashes on;
Context: http, server

Enables or disables compression of two or more adjacent slashes in a URI into a single slash.

Note that compression is essential for the correct matching of prefix string and regular expression locations. Without it, the “//scripts/one.php” request would not match

location /scripts/ {
    ...
}

and might be processed as a static file. So it gets converted to “/scripts/one.php”.

Turning the compression off can become necessary if a URI contains base64-encoded names, since base64 uses the “/” character internally. However, for security considerations, it is better to avoid turning the compression off.

If the directive is specified on the server level, its value is only used if a server is a default one. The value specified also applies to all virtual servers listening on the same address and port.

doc_nginx
2017-02-09 07:07:02
Comments
Leave a Comment

Please login to continue.