aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 666d96fb3..b046235fd 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -120,6 +120,14 @@ static ngx_conf_enum_t ngx_http_core_lingering_close[] = {
};
+static ngx_conf_enum_t ngx_http_core_server_tokens[] = {
+ { ngx_string("off"), NGX_HTTP_SERVER_TOKENS_OFF },
+ { ngx_string("on"), NGX_HTTP_SERVER_TOKENS_ON },
+ { ngx_string("build"), NGX_HTTP_SERVER_TOKENS_BUILD },
+ { ngx_null_string, 0 }
+};
+
+
static ngx_conf_enum_t ngx_http_core_if_modified_since[] = {
{ ngx_string("off"), NGX_HTTP_IMS_OFF },
{ ngx_string("exact"), NGX_HTTP_IMS_EXACT },
@@ -599,11 +607,11 @@ static ngx_command_t ngx_http_core_commands[] = {
NULL },
{ ngx_string("server_tokens"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_enum_slot,
NGX_HTTP_LOC_CONF_OFFSET,
offsetof(ngx_http_core_loc_conf_t, server_tokens),
- NULL },
+ &ngx_http_core_server_tokens },
{ ngx_string("if_modified_since"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
@@ -3576,9 +3584,9 @@ ngx_http_core_create_loc_conf(ngx_conf_t *cf)
clcf->log_not_found = NGX_CONF_UNSET;
clcf->log_subrequest = NGX_CONF_UNSET;
clcf->recursive_error_pages = NGX_CONF_UNSET;
- clcf->server_tokens = NGX_CONF_UNSET;
clcf->chunked_transfer_encoding = NGX_CONF_UNSET;
clcf->etag = NGX_CONF_UNSET;
+ clcf->server_tokens = NGX_CONF_UNSET_UINT;
clcf->types_hash_max_size = NGX_CONF_UNSET_UINT;
clcf->types_hash_bucket_size = NGX_CONF_UNSET_UINT;
@@ -3842,11 +3850,13 @@ ngx_http_core_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_value(conf->log_subrequest, prev->log_subrequest, 0);
ngx_conf_merge_value(conf->recursive_error_pages,
prev->recursive_error_pages, 0);
- ngx_conf_merge_value(conf->server_tokens, prev->server_tokens, 1);
ngx_conf_merge_value(conf->chunked_transfer_encoding,
prev->chunked_transfer_encoding, 1);
ngx_conf_merge_value(conf->etag, prev->etag, 1);
+ ngx_conf_merge_uint_value(conf->server_tokens, prev->server_tokens,
+ NGX_HTTP_SERVER_TOKENS_ON);
+
ngx_conf_merge_ptr_value(conf->open_file_cache,
prev->open_file_cache, NULL);