Ticket #1549: https.patch

File https.patch, 709 bytes (added by Roel van Duijnhoven, 8 years ago)

Patch that sets https scheme correctly when using proxy protocol

  • src/http/ngx_http_variables.c

    diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c
    index 2deb9689..261117f1 100644
    a b ngx_http_variable_scheme(ngx_http_request_t *r,  
    14221422{
    14231423#if (NGX_HTTP_SSL)
    14241424
    1425     if (r->connection->ssl) {
     1425    if (r->schema_end == r->schema_start + 5) {
    14261426        v->len = sizeof("https") - 1;
    14271427        v->valid = 1;
    14281428        v->no_cacheable = 0;
    ngx_http_variable_https(ngx_http_request_t *r,  
    14501450{
    14511451#if (NGX_HTTP_SSL)
    14521452
    1453     if (r->connection->ssl) {
     1453    if (r->schema_end == r->schema_start + 5) {
    14541454        v->len = sizeof("on") - 1;
    14551455        v->valid = 1;
    14561456        v->no_cacheable = 0;