diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2007-04-10 07:08:06 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2007-04-10 07:08:06 +0000 |
| commit | 2723361e760a6ffe61889c92f714814cfa5a92e3 (patch) | |
| tree | 485accd7ca350ca731aa1acfd0e881005ac89331 /src/http/ngx_http_upstream.c | |
| parent | da4b660274811c33a328cb1b0fa9dc41f694bc16 (diff) | |
| download | nginx-2723361e760a6ffe61889c92f714814cfa5a92e3.tar.gz nginx-2723361e760a6ffe61889c92f714814cfa5a92e3.tar.bz2 | |
$upstream_http_... variables
Diffstat (limited to 'src/http/ngx_http_upstream.c')
| -rw-r--r-- | src/http/ngx_http_upstream.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index 888bb3b26..273c782f7 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -2608,6 +2608,21 @@ ngx_http_upstream_response_time_variable(ngx_http_request_t *r, } +ngx_int_t +ngx_http_upstream_header_variable(ngx_http_request_t *r, + ngx_http_variable_value_t *v, uintptr_t data) +{ + if (r->upstream == NULL) { + v->not_found = 1; + return NGX_OK; + } + + return ngx_http_variable_unknown_header(v, (ngx_str_t *) data, + &r->upstream->headers_in.headers.part, + sizeof("upstream_http_") - 1); +} + + static char * ngx_http_upstream(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy) { |
