Changeset 6747:20eb4587225b in nginx


Ignore:
Timestamp:
10/14/16 16:48:26 (3 years ago)
Author:
Maxim Dounin <mdounin@…>
Branch:
default
Phase:
public
Message:

Upstream: handling of proxy_set_header at http level.

When headers are set at the "http" level and not redefined in
a server block, we now preserve conf->headers into the "http"
section configuration to inherit it to all servers.

The same applies to conf->headers_cache, though it may not be effective
if no servers use cache at the "server" level as conf->headers_cache
is only initialized if cache is enabled on a given level.

Similar changes made in fastcgi/scgi/uwsgi to preserve conf->params
and conf->params_cache.

Location:
src/http/modules
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/http/modules/ngx_http_fastcgi_module.c

    r6530 r6747  
    31283128#endif
    31293129
     3130    /*
     3131     * special handling to preserve conf->params in the "http" section
     3132     * to inherit it to all servers
     3133     */
     3134
     3135    if (prev->params.hash.buckets == NULL
     3136        && conf->params_source == prev->params_source)
     3137    {
     3138        prev->params = conf->params;
     3139#if (NGX_HTTP_CACHE)
     3140        prev->params_cache = conf->params_cache;
     3141#endif
     3142    }
     3143
    31303144    return NGX_CONF_OK;
    31313145}
  • src/http/modules/ngx_http_proxy_module.c

    r6746 r6747  
    33583358#endif
    33593359
     3360    /*
     3361     * special handling to preserve conf->headers in the "http" section
     3362     * to inherit it to all servers
     3363     */
     3364
     3365    if (prev->headers.hash.buckets == NULL
     3366        && conf->headers_source == prev->headers_source)
     3367    {
     3368        prev->headers = conf->headers;
     3369#if (NGX_HTTP_CACHE)
     3370        prev->headers_cache = conf->headers_cache;
     3371#endif
     3372    }
     3373
    33603374    return NGX_CONF_OK;
    33613375}
  • src/http/modules/ngx_http_scgi_module.c

    r6530 r6747  
    15591559#endif
    15601560
     1561    /*
     1562     * special handling to preserve conf->params in the "http" section
     1563     * to inherit it to all servers
     1564     */
     1565
     1566    if (prev->params.hash.buckets == NULL
     1567        && conf->params_source == prev->params_source)
     1568    {
     1569        prev->params = conf->params;
     1570#if (NGX_HTTP_CACHE)
     1571        prev->params_cache = conf->params_cache;
     1572#endif
     1573    }
     1574
    15611575    return NGX_CONF_OK;
    15621576}
  • src/http/modules/ngx_http_uwsgi_module.c

    r6591 r6747  
    18211821#endif
    18221822
     1823    /*
     1824     * special handling to preserve conf->params in the "http" section
     1825     * to inherit it to all servers
     1826     */
     1827
     1828    if (prev->params.hash.buckets == NULL
     1829        && conf->params_source == prev->params_source)
     1830    {
     1831        prev->params = conf->params;
     1832#if (NGX_HTTP_CACHE)
     1833        prev->params_cache = conf->params_cache;
     1834#endif
     1835    }
     1836
    18231837    return NGX_CONF_OK;
    18241838}
Note: See TracChangeset for help on using the changeset viewer.