nginx-0.1.13-RELEASE import
*) Feature: the server_names_hash and server_names_hash_threshold
directives.
*) Bugfix: the *.domain.tld names in the "server_name" directive did
not work.
*) Bugfix: the %request_length log parameter logged the incorrect
length.
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index e3ccd8f..478bb08 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -60,6 +60,20 @@
static ngx_command_t ngx_http_core_commands[] = {
+ { ngx_string("server_names_hash"),
+ NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_num_slot,
+ NGX_HTTP_MAIN_CONF_OFFSET,
+ offsetof(ngx_http_core_main_conf_t, server_names_hash),
+ NULL },
+
+ { ngx_string("server_names_hash_threshold"),
+ NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_num_slot,
+ NGX_HTTP_MAIN_CONF_OFFSET,
+ offsetof(ngx_http_core_main_conf_t, server_names_hash_threshold),
+ NULL },
+
{ ngx_string("server"),
NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
ngx_server_block,
@@ -1244,17 +1258,24 @@
5, sizeof(ngx_http_core_srv_conf_t *),
NGX_CONF_ERROR);
+ cmcf->server_names_hash = NGX_CONF_UNSET_UINT;
+ cmcf->server_names_hash_threshold = NGX_CONF_UNSET_UINT;
+
return cmcf;
}
static char *ngx_http_core_init_main_conf(ngx_conf_t *cf, void *conf)
{
-#if 0
ngx_http_core_main_conf_t *cmcf = conf;
- /* TODO: remove it if no directives */
-#endif
+ if (cmcf->server_names_hash == NGX_CONF_UNSET_UINT) {
+ cmcf->server_names_hash = 1009;
+ }
+
+ if (cmcf->server_names_hash_threshold == NGX_CONF_UNSET_UINT) {
+ cmcf->server_names_hash_threshold = 50;
+ }
return NGX_CONF_OK;
}