aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http.c14
-rw-r--r--src/http/ngx_http_core_module.c21
-rw-r--r--src/http/ngx_http_core_module.h1
3 files changed, 10 insertions, 26 deletions
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index 4e5500fb4..a1c4c9892 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -1314,9 +1314,8 @@ ngx_http_optimize_servers(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf,
sizeof(ngx_http_conf_in_addr_t), ngx_http_cmp_conf_in_addrs);
/*
- * check whether all name-based servers have the same configuraiton
- * as the default server,
- * or some servers disable optimizing the server names
+ * check whether all name-based servers have
+ * the same configuraiton as the default server
*/
in_addr = in_port[p].addrs.elts;
@@ -1325,18 +1324,15 @@ ngx_http_optimize_servers(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf,
name = in_addr[a].names.elts;
for (s = 0; s < in_addr[a].names.nelts; s++) {
- if (in_addr[a].core_srv_conf != name[s].core_srv_conf
- || name[s].core_srv_conf->optimize_server_names == 0)
- {
+ if (in_addr[a].core_srv_conf != name[s].core_srv_conf) {
goto virtual_names;
}
}
/*
* if all name-based servers have the same configuration
- * as the default server,
- * and no servers disable optimizing the server names
- * then we do not need to check them at run-time at all
+ * as the default server, then we do not need to check
+ * them at run-time at all
*/
in_addr[a].names.nelts = 0;
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index e0f1e1f90..76d40ea0f 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -79,8 +79,8 @@ static ngx_conf_post_t ngx_http_core_lowat_post =
static ngx_conf_post_handler_pt ngx_http_core_pool_size_p =
ngx_http_core_pool_size;
-static ngx_conf_deprecated_t ngx_conf_deprecated_optimize_host_names = {
- ngx_conf_deprecated, "optimize_host_names", "optimize_server_names"
+static ngx_conf_deprecated_t ngx_conf_deprecated_optimize_server_names = {
+ ngx_conf_deprecated, "optimize_server_names", "server_name_in_redirect"
};
static ngx_conf_deprecated_t ngx_conf_deprecated_open_file_cache_retest = {
@@ -212,16 +212,9 @@ static ngx_command_t ngx_http_core_commands[] = {
{ ngx_string("optimize_server_names"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
ngx_conf_set_flag_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_core_srv_conf_t, optimize_server_names),
- NULL },
-
- { ngx_string("optimize_host_names"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_core_srv_conf_t, optimize_server_names),
- &ngx_conf_deprecated_optimize_host_names },
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_core_loc_conf_t, server_name_in_redirect),
+ &ngx_conf_deprecated_optimize_server_names },
{ ngx_string("ignore_invalid_headers"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
@@ -2419,7 +2412,6 @@ ngx_http_core_create_srv_conf(ngx_conf_t *cf)
cscf->request_pool_size = NGX_CONF_UNSET_SIZE;
cscf->client_header_timeout = NGX_CONF_UNSET_MSEC;
cscf->client_header_buffer_size = NGX_CONF_UNSET_SIZE;
- cscf->optimize_server_names = NGX_CONF_UNSET;
cscf->ignore_invalid_headers = NGX_CONF_UNSET;
cscf->merge_slashes = NGX_CONF_UNSET;
@@ -2495,9 +2487,6 @@ ngx_http_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
return NGX_CONF_ERROR;
}
- ngx_conf_merge_value(conf->optimize_server_names,
- prev->optimize_server_names, 1);
-
ngx_conf_merge_value(conf->ignore_invalid_headers,
prev->ignore_invalid_headers, 1);
diff --git a/src/http/ngx_http_core_module.h b/src/http/ngx_http_core_module.h
index 0bf96cb5b..85d96b079 100644
--- a/src/http/ngx_http_core_module.h
+++ b/src/http/ngx_http_core_module.h
@@ -150,7 +150,6 @@ typedef struct {
ngx_msec_t client_header_timeout;
- ngx_flag_t optimize_server_names;
ngx_flag_t ignore_invalid_headers;
ngx_flag_t merge_slashes;