Mercurial > hg > nginx-quic
comparison src/http/modules/ngx_http_proxy_module.c @ 5937:5b9f711dc819
Upstream: inheritance of proxy_pass and friends (ticket #645).
Instead of independant inheritance of conf->upstream.upstream (proxy_pass
without variables) and conf->proxy_lengths (proxy_pass with variables)
we now test them both and inherit only if neither is set. Additionally,
SSL context is also inherited only in this case now.
Based on the patch by Alexey Radkov.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 09 Dec 2014 18:21:55 +0300 |
parents | 2d3908516101 |
children | cd2abf7e7740 |
comparison
equal
deleted
inserted
replaced
5936:2d3908516101 | 5937:5b9f711dc819 |
---|---|
2966 | 2966 |
2967 ngx_conf_merge_ptr_value(conf->cookie_domains, prev->cookie_domains, NULL); | 2967 ngx_conf_merge_ptr_value(conf->cookie_domains, prev->cookie_domains, NULL); |
2968 | 2968 |
2969 ngx_conf_merge_ptr_value(conf->cookie_paths, prev->cookie_paths, NULL); | 2969 ngx_conf_merge_ptr_value(conf->cookie_paths, prev->cookie_paths, NULL); |
2970 | 2970 |
2971 #if (NGX_HTTP_SSL) | |
2972 if (conf->upstream.ssl == NULL) { | |
2973 conf->upstream.ssl = prev->upstream.ssl; | |
2974 } | |
2975 #endif | |
2976 | |
2977 ngx_conf_merge_uint_value(conf->http_version, prev->http_version, | 2971 ngx_conf_merge_uint_value(conf->http_version, prev->http_version, |
2978 NGX_HTTP_VERSION_10); | 2972 NGX_HTTP_VERSION_10); |
2979 | 2973 |
2980 ngx_conf_merge_uint_value(conf->headers_hash_max_size, | 2974 ngx_conf_merge_uint_value(conf->headers_hash_max_size, |
2981 prev->headers_hash_max_size, 512); | 2975 prev->headers_hash_max_size, 512); |
2995 != NGX_OK) | 2989 != NGX_OK) |
2996 { | 2990 { |
2997 return NGX_CONF_ERROR; | 2991 return NGX_CONF_ERROR; |
2998 } | 2992 } |
2999 | 2993 |
3000 if (conf->upstream.upstream == NULL) { | 2994 if (conf->upstream.upstream == NULL && conf->proxy_lengths == NULL) { |
3001 conf->upstream.upstream = prev->upstream.upstream; | 2995 conf->upstream.upstream = prev->upstream.upstream; |
3002 conf->vars = prev->vars; | 2996 conf->vars = prev->vars; |
3003 } | 2997 |
3004 | |
3005 if (conf->proxy_lengths == NULL) { | |
3006 conf->proxy_lengths = prev->proxy_lengths; | 2998 conf->proxy_lengths = prev->proxy_lengths; |
3007 conf->proxy_values = prev->proxy_values; | 2999 conf->proxy_values = prev->proxy_values; |
3000 | |
3001 #if (NGX_HTTP_SSL) | |
3002 conf->upstream.ssl = prev->upstream.ssl; | |
3003 #endif | |
3008 } | 3004 } |
3009 | 3005 |
3010 if (conf->upstream.upstream || conf->proxy_lengths) { | 3006 if (conf->upstream.upstream || conf->proxy_lengths) { |
3011 clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); | 3007 clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); |
3012 if (clcf->handler == NULL && clcf->lmt_excpt) { | 3008 if (clcf->handler == NULL && clcf->lmt_excpt) { |