diff options
author | Igor Sysoev <igor@sysoev.ru> | 2011-01-20 15:31:24 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2011-01-20 15:31:24 +0000 |
commit | 8dbc8a97dd7e2164aeeef2d3be6aca1c3a29baee (patch) | |
tree | 188caee134b9f01c136b9fe39ae266e0d79e609d | |
parent | d19c93d127ef8a018bad0612f2a6e1fcb6cfa6fe (diff) | |
download | nginx-8dbc8a97dd7e2164aeeef2d3be6aca1c3a29baee.tar.gz nginx-8dbc8a97dd7e2164aeeef2d3be6aca1c3a29baee.zip |
server_name $hostname
-rw-r--r-- | src/http/ngx_http_core_module.c | 8 |
1 files changed, 7 insertions, 1 deletions
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); |