From 8dbc8a97dd7e2164aeeef2d3be6aca1c3a29baee Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Thu, 20 Jan 2011 15:31:24 +0000 Subject: server_name $hostname --- src/http/ngx_http_core_module.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index 5e682f2b9..693a3cb32 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -3682,7 +3682,13 @@ ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) sn->regex = NULL; #endif sn->server = cscf; - sn->name = value[i]; + + if (ngx_strcasecmp(value[i].data, (u_char *) "$hostname") == 0) { + sn->name = cf->cycle->hostname; + + } else { + sn->name = value[i]; + } if (value[i].data[0] != '~') { ngx_strlow(sn->name.data, sn->name.data, sn->name.len); -- cgit