Mercurial > hg > nginx
comparison src/http/modules/ngx_http_proxy_module.c @ 3670:2728c4e4a9ae
do not use a cache headers set to hide
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 02 Jul 2010 10:05:40 +0000 |
parents | 12bd9e26fadb |
children | 045ea40cbfe8 |
comparison
equal
deleted
inserted
replaced
3669:1f5841b1fcd7 | 3670:2728c4e4a9ae |
---|---|
508 { ngx_string("If-None-Match"), ngx_string("") }, | 508 { ngx_string("If-None-Match"), ngx_string("") }, |
509 { ngx_string("If-Match"), ngx_string("") }, | 509 { ngx_string("If-Match"), ngx_string("") }, |
510 { ngx_string("Range"), ngx_string("") }, | 510 { ngx_string("Range"), ngx_string("") }, |
511 { ngx_string("If-Range"), ngx_string("") }, | 511 { ngx_string("If-Range"), ngx_string("") }, |
512 { ngx_null_string, ngx_null_string } | 512 { ngx_null_string, ngx_null_string } |
513 }; | |
514 | |
515 | |
516 static ngx_str_t ngx_http_proxy_hide_cache_headers[] = { | |
517 ngx_string("Date"), | |
518 ngx_string("Server"), | |
519 ngx_string("X-Pad"), | |
520 ngx_string("X-Accel-Expires"), | |
521 ngx_string("X-Accel-Redirect"), | |
522 ngx_string("X-Accel-Limit-Rate"), | |
523 ngx_string("X-Accel-Buffering"), | |
524 ngx_string("X-Accel-Charset"), | |
525 ngx_string("Set-Cookie"), | |
526 ngx_string("P3P"), | |
527 ngx_null_string | |
528 }; | 513 }; |
529 | 514 |
530 #endif | 515 #endif |
531 | 516 |
532 | 517 |
1723 { | 1708 { |
1724 ngx_http_proxy_loc_conf_t *prev = parent; | 1709 ngx_http_proxy_loc_conf_t *prev = parent; |
1725 ngx_http_proxy_loc_conf_t *conf = child; | 1710 ngx_http_proxy_loc_conf_t *conf = child; |
1726 | 1711 |
1727 size_t size; | 1712 size_t size; |
1728 ngx_str_t *h; | |
1729 ngx_keyval_t *s; | 1713 ngx_keyval_t *s; |
1730 ngx_hash_init_t hash; | 1714 ngx_hash_init_t hash; |
1731 ngx_http_proxy_redirect_t *pr; | 1715 ngx_http_proxy_redirect_t *pr; |
1732 ngx_http_script_compile_t sc; | 1716 ngx_http_script_compile_t sc; |
1733 | 1717 |
2007 | 1991 |
2008 hash.max_size = conf->headers_hash_max_size; | 1992 hash.max_size = conf->headers_hash_max_size; |
2009 hash.bucket_size = conf->headers_hash_bucket_size; | 1993 hash.bucket_size = conf->headers_hash_bucket_size; |
2010 hash.name = "proxy_headers_hash"; | 1994 hash.name = "proxy_headers_hash"; |
2011 | 1995 |
2012 #if (NGX_HTTP_CACHE) | |
2013 | |
2014 h = conf->upstream.cache ? ngx_http_proxy_hide_cache_headers: | |
2015 ngx_http_proxy_hide_headers; | |
2016 #else | |
2017 | |
2018 h = ngx_http_proxy_hide_headers; | |
2019 | |
2020 #endif | |
2021 | |
2022 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream, | 1996 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream, |
2023 &prev->upstream, h, &hash) | 1997 &prev->upstream, ngx_http_proxy_hide_headers, &hash) |
2024 != NGX_OK) | 1998 != NGX_OK) |
2025 { | 1999 { |
2026 return NGX_CONF_ERROR; | 2000 return NGX_CONF_ERROR; |
2027 } | 2001 } |
2028 | 2002 |