Ticket #1549: patch

File patch, 1.0 KB (added by Ruslan Ermilov, 8 years ago)
  • src/http/v2/ngx_http_v2_filter_module.c

    # 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 b ngx_http_v2_push_resource(ngx_http_reque  
    10261026    pos = ngx_http_v2_write_value(pos, path->data, path->len, tmp);
    10271027
    10281028#if (NGX_HTTP_SSL)
    1029     if (fc->ssl) {
     1029    if (r->schema_end == r->schema_start + 5) {
    10301030        ngx_log_debug0(NGX_LOG_DEBUG_HTTP, fc->log, 0,
    10311031                       "http2 push header: \":scheme: https\"");
    10321032        *pos++ = ngx_http_v2_indexed(NGX_HTTP_V2_SCHEME_HTTPS_INDEX);