comparison src/http/modules/ngx_http_proxy_module.c @ 584:016632f0fb18 NGINX_0_8_44

nginx 0.8.44 *) Change: now nginx does not cache by default backend responses, if they have a "Set-Cookie" header line. *) Feature: the "listen" directive supports the "setfib" parameter. Thanks to Andrew Filonov. *) Bugfix: the "sub_filter" directive might change character case on partial match. *) Bugfix: compatibility with HP/UX. *) Bugfix: compatibility with AIX xcl_r compiler. *) Bugfix: nginx treated a large SSLv2 packets as plain requests. Thanks to Miroslaw Jaworski.
author Igor Sysoev <http://sysoev.ru>
date Mon, 05 Jul 2010 00:00:00 +0400
parents 4d3e880ce86c
children b6a5942a4e6a
comparison
equal deleted inserted replaced
583:39e50617266a 584:016632f0fb18
155 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, 155 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF },
156 { ngx_null_string, 0 } 156 { ngx_null_string, 0 }
157 }; 157 };
158 158
159 159
160 static ngx_conf_bitmask_t ngx_http_proxy_ignore_headers_masks[] = {
161 { ngx_string("X-Accel-Redirect"), NGX_HTTP_UPSTREAM_IGN_XA_REDIRECT },
162 { ngx_string("X-Accel-Expires"), NGX_HTTP_UPSTREAM_IGN_XA_EXPIRES },
163 { ngx_string("Expires"), NGX_HTTP_UPSTREAM_IGN_EXPIRES },
164 { ngx_string("Cache-Control"), NGX_HTTP_UPSTREAM_IGN_CACHE_CONTROL },
165 { ngx_null_string, 0 }
166 };
167
168
169 ngx_module_t ngx_http_proxy_module; 160 ngx_module_t ngx_http_proxy_module;
170 161
171 162
172 static ngx_command_t ngx_http_proxy_commands[] = { 163 static ngx_command_t ngx_http_proxy_commands[] = {
173 164
430 { ngx_string("proxy_ignore_headers"), 421 { ngx_string("proxy_ignore_headers"),
431 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, 422 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
432 ngx_conf_set_bitmask_slot, 423 ngx_conf_set_bitmask_slot,
433 NGX_HTTP_LOC_CONF_OFFSET, 424 NGX_HTTP_LOC_CONF_OFFSET,
434 offsetof(ngx_http_proxy_loc_conf_t, upstream.ignore_headers), 425 offsetof(ngx_http_proxy_loc_conf_t, upstream.ignore_headers),
435 &ngx_http_proxy_ignore_headers_masks }, 426 &ngx_http_upstream_ignore_headers_masks },
436 427
437 #if (NGX_HTTP_SSL) 428 #if (NGX_HTTP_SSL)
438 429
439 { ngx_string("proxy_ssl_session_reuse"), 430 { ngx_string("proxy_ssl_session_reuse"),
440 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, 431 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
517 { ngx_string("If-None-Match"), ngx_string("") }, 508 { ngx_string("If-None-Match"), ngx_string("") },
518 { ngx_string("If-Match"), ngx_string("") }, 509 { ngx_string("If-Match"), ngx_string("") },
519 { ngx_string("Range"), ngx_string("") }, 510 { ngx_string("Range"), ngx_string("") },
520 { ngx_string("If-Range"), ngx_string("") }, 511 { ngx_string("If-Range"), ngx_string("") },
521 { ngx_null_string, ngx_null_string } 512 { ngx_null_string, ngx_null_string }
522 };
523
524
525 static ngx_str_t ngx_http_proxy_hide_cache_headers[] = {
526 ngx_string("Date"),
527 ngx_string("Server"),
528 ngx_string("X-Pad"),
529 ngx_string("X-Accel-Expires"),
530 ngx_string("X-Accel-Redirect"),
531 ngx_string("X-Accel-Limit-Rate"),
532 ngx_string("X-Accel-Buffering"),
533 ngx_string("X-Accel-Charset"),
534 ngx_string("Set-Cookie"),
535 ngx_string("P3P"),
536 ngx_null_string
537 }; 513 };
538 514
539 #endif 515 #endif
540 516
541 517
1732 { 1708 {
1733 ngx_http_proxy_loc_conf_t *prev = parent; 1709 ngx_http_proxy_loc_conf_t *prev = parent;
1734 ngx_http_proxy_loc_conf_t *conf = child; 1710 ngx_http_proxy_loc_conf_t *conf = child;
1735 1711
1736 size_t size; 1712 size_t size;
1737 ngx_str_t *h;
1738 ngx_keyval_t *s; 1713 ngx_keyval_t *s;
1739 ngx_hash_init_t hash; 1714 ngx_hash_init_t hash;
1740 ngx_http_proxy_redirect_t *pr; 1715 ngx_http_proxy_redirect_t *pr;
1741 ngx_http_script_compile_t sc; 1716 ngx_http_script_compile_t sc;
1742 1717
2016 1991
2017 hash.max_size = conf->headers_hash_max_size; 1992 hash.max_size = conf->headers_hash_max_size;
2018 hash.bucket_size = conf->headers_hash_bucket_size; 1993 hash.bucket_size = conf->headers_hash_bucket_size;
2019 hash.name = "proxy_headers_hash"; 1994 hash.name = "proxy_headers_hash";
2020 1995
2021 #if (NGX_HTTP_CACHE)
2022
2023 h = conf->upstream.cache ? ngx_http_proxy_hide_cache_headers:
2024 ngx_http_proxy_hide_headers;
2025 #else
2026
2027 h = ngx_http_proxy_hide_headers;
2028
2029 #endif
2030
2031 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream, 1996 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream,
2032 &prev->upstream, h, &hash) 1997 &prev->upstream, ngx_http_proxy_hide_headers, &hash)
2033 != NGX_OK) 1998 != NGX_OK)
2034 { 1999 {
2035 return NGX_CONF_ERROR; 2000 return NGX_CONF_ERROR;
2036 } 2001 }
2037 2002