# HG changeset patch
# User Ruslan Ermilov <ru@nginx.com>
# Date 1525955573 -10800
#      Thu May 10 15:32:53 2018 +0300
# Node ID 562b5babb82fc07ab82cc571f944220223e9b319
# Parent  ceab908790c4eb7cd01c40bd16581ef794222ca5
HTTP/2: use scheme from original request for pushes (closes #1549).

Instead of the connection scheme, use scheme from the original request.
This fixes pushes when SSL is terminated by a proxy server in front of
nginx.

diff --git a/src/http/v2/ngx_http_v2_filter_module.c b/src/http/v2/ngx_http_v2_filter_module.c
--- a/src/http/v2/ngx_http_v2_filter_module.c
+++ b/src/http/v2/ngx_http_v2_filter_module.c
@@ -1026,7 +1026,7 @@ ngx_http_v2_push_resource(ngx_http_reque
     pos = ngx_http_v2_write_value(pos, path->data, path->len, tmp);
 
 #if (NGX_HTTP_SSL)
-    if (fc->ssl) {
+    if (r->schema_end == r->schema_start + 5) {
         ngx_log_debug0(NGX_LOG_DEBUG_HTTP, fc->log, 0,
                        "http2 push header: \":scheme: https\"");
         *pos++ = ngx_http_v2_indexed(NGX_HTTP_V2_SCHEME_HTTPS_INDEX);
