diff options
Diffstat (limited to 'src/http/modules/ngx_http_rewrite_module.c')
-rw-r--r-- | src/http/modules/ngx_http_rewrite_module.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c index 6b2444cbd..a6f1fc820 100644 --- a/src/http/modules/ngx_http_rewrite_module.c +++ b/src/http/modules/ngx_http_rewrite_module.c @@ -917,7 +917,8 @@ ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) value[1].len--; value[1].data++; - v = ngx_http_add_variable(cf, &value[1], NGX_HTTP_VAR_CHANGEABLE); + v = ngx_http_add_variable(cf, &value[1], + NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_WEAK); if (v == NULL) { return NGX_CONF_ERROR; } @@ -927,15 +928,7 @@ ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) return NGX_CONF_ERROR; } - if (v->get_handler == NULL - && ngx_strncasecmp(value[1].data, (u_char *) "http_", 5) != 0 - && ngx_strncasecmp(value[1].data, (u_char *) "sent_http_", 10) != 0 - && ngx_strncasecmp(value[1].data, (u_char *) "upstream_http_", 14) != 0 - && ngx_strncasecmp(value[1].data, (u_char *) "cookie_", 7) != 0 - && ngx_strncasecmp(value[1].data, (u_char *) "upstream_cookie_", 16) - != 0 - && ngx_strncasecmp(value[1].data, (u_char *) "arg_", 4) != 0) - { + if (v->get_handler == NULL) { v->get_handler = ngx_http_rewrite_var; v->data = index; } |