diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c index 6b1977340..ddd72493f 100644 --- a/src/http/modules/ngx_http_fastcgi_module.c +++ b/src/http/modules/ngx_http_fastcgi_module.c @@ -656,6 +656,13 @@ static ngx_str_t ngx_http_fastcgi_hide_headers[] = { }; +static ngx_keyval_t ngx_http_fastcgi_headers[] = { + { ngx_string("HTTP_HOST"), + ngx_string("$host$is_request_port$request_port") }, + { ngx_null_string, ngx_null_string } +}; + + #if (NGX_HTTP_CACHE) static ngx_keyval_t ngx_http_fastcgi_cache_headers[] = { @@ -3276,7 +3283,8 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) conf->params_source = prev->params_source; } - rc = ngx_http_fastcgi_init_params(cf, conf, &conf->params, NULL); + rc = ngx_http_fastcgi_init_params(cf, conf, &conf->params, + ngx_http_fastcgi_headers); if (rc != NGX_OK) { return NGX_CONF_ERROR; } diff --git a/src/http/modules/ngx_http_scgi_module.c b/src/http/modules/ngx_http_scgi_module.c index 49977b07b..ffb1d0874 100644 --- a/src/http/modules/ngx_http_scgi_module.c +++ b/src/http/modules/ngx_http_scgi_module.c @@ -453,6 +453,13 @@ static ngx_str_t ngx_http_scgi_hide_headers[] = { }; +static ngx_keyval_t ngx_http_scgi_headers[] = { + { ngx_string("HTTP_HOST"), + ngx_string("$host$is_request_port$request_port") }, + { ngx_null_string, ngx_null_string } +}; + + #if (NGX_HTTP_CACHE) static ngx_keyval_t ngx_http_scgi_cache_headers[] = { @@ -1675,7 +1682,8 @@ ngx_http_scgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) conf->params_source = prev->params_source; } - rc = ngx_http_scgi_init_params(cf, conf, &conf->params, NULL); + rc = ngx_http_scgi_init_params(cf, conf, &conf->params, + ngx_http_scgi_headers); if (rc != NGX_OK) { return NGX_CONF_ERROR; } diff --git a/src/http/modules/ngx_http_uwsgi_module.c b/src/http/modules/ngx_http_uwsgi_module.c index c1d0035cc..41fa815dc 100644 --- a/src/http/modules/ngx_http_uwsgi_module.c +++ b/src/http/modules/ngx_http_uwsgi_module.c @@ -629,6 +629,13 @@ static ngx_str_t ngx_http_uwsgi_hide_headers[] = { }; +static ngx_keyval_t ngx_http_uwsgi_headers[] = { + { ngx_string("HTTP_HOST"), + ngx_string("$host$is_request_port$request_port") }, + { ngx_null_string, ngx_null_string } +}; + + #if (NGX_HTTP_CACHE) static ngx_keyval_t ngx_http_uwsgi_cache_headers[] = { @@ -1995,7 +2002,8 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) conf->params_source = prev->params_source; } - rc = ngx_http_uwsgi_init_params(cf, conf, &conf->params, NULL); + rc = ngx_http_uwsgi_init_params(cf, conf, &conf->params, + ngx_http_uwsgi_headers); if (rc != NGX_OK) { return NGX_CONF_ERROR; }