Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2011-01-20 18:31:24 +0300
committerIgor Sysoev <igor@sysoev.ru>2011-01-20 18:31:24 +0300
commit8dbc8a97dd7e2164aeeef2d3be6aca1c3a29baee (patch)
tree188caee134b9f01c136b9fe39ae266e0d79e609d /src
parentd19c93d127ef8a018bad0612f2a6e1fcb6cfa6fe (diff)
server_name $hostname
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_core_module.c8
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);