diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-04-29 10:06:43 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-04-29 10:06:43 +0000 |
commit | 615fe7f4be641d370704eb4694ba101ec93895ad (patch) | |
tree | 1497921ed6d101a5bc49802432569aa001887c1a /src/http/ngx_http_core_module.c | |
parent | 49db9d4602daa479e313cedc5ef5778221952301 (diff) | |
download | nginx-615fe7f4be641d370704eb4694ba101ec93895ad.tar.gz nginx-615fe7f4be641d370704eb4694ba101ec93895ad.zip |
args support in static error_page
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r-- | src/http/ngx_http_core_module.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index 5eed3b1e1..f57db3622 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -3471,6 +3471,7 @@ ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) { ngx_http_core_loc_conf_t *lcf = conf; + u_char *args; ngx_int_t overwrite; ngx_str_t *value, uri; ngx_uint_t i, n, nvar; @@ -3539,6 +3540,8 @@ ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) } } + args = (u_char *) ngx_strchr(uri.data, '?'); + for (i = 1; i < cf->args->nelts - n; i++) { err = ngx_array_push(lcf->error_pages); if (err == NULL) { @@ -3577,7 +3580,19 @@ ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) } } - err->uri = uri; + if (args) { + err->uri.len = args - uri.data; + err->uri.data = uri.data; + args++; + err->args.len = (uri.data + uri.len) - args; + err->args.data = args; + + } else { + err->uri = uri; + err->args.len = 0; + err->args.data = NULL; + } + err->uri_lengths = uri_lengths; err->uri_values = uri_values; } |