]> git.kaiwu.me - nginx.git/commitdiff
use an empty name as default server_name instread of hostname
authorIgor Sysoev <igor@sysoev.ru>
Thu, 29 Jul 2010 10:00:04 +0000 (10:00 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 29 Jul 2010 10:00:04 +0000 (10:00 +0000)
src/http/ngx_http_core_module.c

index 8f1ab08418c4e1439393b961d54071a66e42c888..f4d0aae04a1b7a626caa6f3dc5838c037a86b2ce 100644 (file)
@@ -3011,7 +3011,7 @@ ngx_http_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
     }
 
     if (conf->server_name.data == NULL) {
-        conf->server_name = cf->cycle->hostname;
+        ngx_str_set(&conf->server_name, "");
 
         sn = ngx_array_push(&conf->server_names);
         if (sn == NULL) {
@@ -3022,8 +3022,7 @@ ngx_http_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
         sn->regex = NULL;
 #endif
         sn->server = conf;
-        sn->name.len = conf->server_name.len;
-        sn->name.data = conf->server_name.data;
+        ngx_str_set(&sn->name, "");
     }
 
     return NGX_CONF_OK;