diff --git a/src/shrpx_http2_downstream_connection.cc b/src/shrpx_http2_downstream_connection.cc index 3ed0a6de..22a24cc6 100644 --- a/src/shrpx_http2_downstream_connection.cc +++ b/src/shrpx_http2_downstream_connection.cc @@ -405,7 +405,8 @@ int Http2DownstreamConnection::push_request_headers() nva.push_back(http2::make_nv_ls("x-forwarded-for", (*xff).value)); } - if(downstream_->get_request_method() != "CONNECT") { + if(!get_config()->http2_proxy && !get_config()->client_proxy && + downstream_->get_request_method() != "CONNECT") { // We use same protocol with :scheme header field if(scheme.empty()) { if(client_handler_->get_ssl()) { diff --git a/src/shrpx_http_downstream_connection.cc b/src/shrpx_http_downstream_connection.cc index a7834490..dfd9d97b 100644 --- a/src/shrpx_http_downstream_connection.cc +++ b/src/shrpx_http_downstream_connection.cc @@ -221,7 +221,8 @@ int HttpDownstreamConnection::push_request_headers() http2::sanitize_header_value(hdrs, hdrs.size() - (*xff).value.size()); hdrs += "\r\n"; } - if(downstream_->get_request_method() != "CONNECT") { + if(!get_config()->http2_proxy && !get_config()->client_proxy && + downstream_->get_request_method() != "CONNECT") { hdrs += "X-Forwarded-Proto: "; if(!downstream_->get_request_http2_scheme().empty()) { hdrs += downstream_->get_request_http2_scheme();