diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-10-25 15:20:58 +0000 |
---|---|---|
committer | Jonathan Kolb <jon@b0g.us> | 2004-10-25 15:20:58 +0000 |
commit | 97037d1561937dbd6d738dfce58613349c98eb5a (patch) | |
tree | a239e9ee925bc419f1afb039bfc9109fb8f2d76b /src/http/ngx_http_request.c | |
parent | a3b9eb91d36557964697d6a22ac0ab61d95421cf (diff) | |
download | nginx-0.1.3.tar.gz |
Changes with nginx 0.1.3 25 Oct 2004v0.1.3
*) 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.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 13 |
1 files changed, 11 insertions, 2 deletions
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; |