# HG changeset patch # User Igor Sysoev # Date 1295537484 0 # Node ID 6c5f2ba0397d55fd10513195edff8a6be03df23e # Parent 80cc7c8bb845a70652a84247e05e850bf7adddd3 server_name $hostname diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c --- 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 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);