mirror of
https://github.com/nginx/nginx.git
synced 2026-06-26 03:42:06 +00:00
Fixed config parsing of the last try_files parameter.
Do not taste the last parameter against directory, as otherwise it would
result in the trailing slash being cut from the parameter value.
Notably, this prevents an internal redirect to an empty URI
if the parameter is set to the literal slash:
location / { try_files $uri /; }
This commit is contained in:
parent
e9a70114a2
commit
0750df4f16
1 changed files with 2 additions and 1 deletions
|
|
@ -4789,7 +4789,8 @@ ngx_http_core_try_files(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||
tf[i].name = value[i + 1];
|
||||
|
||||
if (tf[i].name.len > 0
|
||||
&& tf[i].name.data[tf[i].name.len - 1] == '/')
|
||||
&& tf[i].name.data[tf[i].name.len - 1] == '/'
|
||||
&& i + 2 < cf->args->nelts)
|
||||
{
|
||||
tf[i].test_dir = 1;
|
||||
tf[i].name.len--;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue