diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c index 6f1e0344d..0b1a33430 100644 --- a/src/http/ngx_http_variables.c +++ b/src/http/ngx_http_variables.c @@ -2257,6 +2257,7 @@ ngx_http_regex_compile(ngx_conf_t *cf, ngx_regex_compile_t *rc) re->regex = rc->regex; re->ncaptures = rc->captures; + re->name = rc->pattern; cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module); cmcf->ncaptures = ngx_max(cmcf->ncaptures, re->ncaptures); @@ -2274,7 +2275,6 @@ ngx_http_regex_compile(ngx_conf_t *cf, ngx_regex_compile_t *rc) re->variables = rv; re->nvariables = n; - re->name = rc->pattern; size = rc->name_size; p = rc->names;