From 2723361e760a6ffe61889c92f714814cfa5a92e3 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Tue, 10 Apr 2007 07:08:06 +0000 Subject: $upstream_http_... variables --- src/http/ngx_http_upstream.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/http/ngx_http_upstream.c') 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) { -- cgit