From 97037d1561937dbd6d738dfce58613349c98eb5a Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 25 Oct 2004 15:20:58 +0000 Subject: Changes with nginx 0.1.3 25 Oct 2004 *) Feature: the ngx_http_autoindex_module and the autoindex directive. *) Feature: the proxy_set_x_url directive. *) Bugfix: proxy module may get caught in an endless loop when sendfile is not used. --- src/http/ngx_http_request.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/http/ngx_http_request.c') diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 74173d873..d78a779ca 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -84,6 +84,8 @@ ngx_http_header_t ngx_http_headers_in[] = { #if (NGX_HTTP_PROXY) { ngx_string("X-Forwarded-For"), offsetof(ngx_http_headers_in_t, x_forwarded_for) }, + { ngx_string("X-Real-IP"), offsetof(ngx_http_headers_in_t, x_real_ip) }, + { ngx_string("X-URL"), offsetof(ngx_http_headers_in_t, x_url) }, #endif { ngx_null_string, 0 } @@ -351,7 +353,7 @@ static void ngx_http_init_request(ngx_event_t *rev) #endif server_name = cscf->server_names.elts; - r->server_name = &server_name->name; + r->server_name = server_name->name; clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); c->log->file = clcf->err_log->file; @@ -1122,7 +1124,14 @@ static ngx_int_t ngx_http_process_request_header(ngx_http_request_t *r) r->srv_conf = name[i].core_srv_conf->ctx->srv_conf; r->loc_conf = name[i].core_srv_conf->ctx->loc_conf; - r->server_name = &name[i].name; + + if (name[i].wildcard) { + r->server_name.len = r->headers_in.host_name_len; + r->server_name.data = r->headers_in.host->value.data; + + } else { + r->server_name = name[i].name; + } clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); r->connection->log->file = clcf->err_log->file; -- cgit v1.2.1