aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-10-25 15:29:23 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-10-25 15:29:23 +0000
commit723e6cc248470b95f62e338cd5e1a6514975f9cc (patch)
treedd9fb2b16d384f241c2303d3cbb6e25aeeb89ab0 /src/http/ngx_http_request.c
parent4925ed843a96d9b2dbb41ef961cc37e9fa03539a (diff)
downloadnginx-723e6cc248470b95f62e338cd5e1a6514975f9cc.tar.gz
nginx-723e6cc248470b95f62e338cd5e1a6514975f9cc.zip
nginx-0.1.3-RELEASE importrelease-0.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.c13
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;