comparison src/http/modules/ngx_http_proxy_module.c @ 2786:4e002555652d

proxy_ignore_headers and fastcgi_ignore_headers
author Igor Sysoev <igor@sysoev.ru>
date Thu, 30 Apr 2009 16:15:07 +0000
parents c2230102df6f
children 6e1941b321b7
comparison
equal deleted inserted replaced
2785:d478379e51ac 2786:4e002555652d
170 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, 170 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF },
171 { ngx_null_string, 0 } 171 { ngx_null_string, 0 }
172 }; 172 };
173 173
174 174
175 static ngx_conf_bitmask_t ngx_http_proxy_ignore_headers_masks[] = {
176 { ngx_string("X-Accel-Redirect"), NGX_HTTP_UPSTREAM_IGN_XA_REDIRECT },
177 { ngx_string("X-Accel-Expires"), NGX_HTTP_UPSTREAM_IGN_XA_EXPIRES },
178 { ngx_string("Expires"), NGX_HTTP_UPSTREAM_IGN_EXPIRES },
179 { ngx_string("Cache-Control"), NGX_HTTP_UPSTREAM_IGN_CACHE_CONTROL },
180 { ngx_null_string, 0 }
181 };
182
183
175 ngx_module_t ngx_http_proxy_module; 184 ngx_module_t ngx_http_proxy_module;
176 185
177 186
178 static ngx_command_t ngx_http_proxy_commands[] = { 187 static ngx_command_t ngx_http_proxy_commands[] = {
179 188
423 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, 432 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
424 ngx_conf_set_str_array_slot, 433 ngx_conf_set_str_array_slot,
425 NGX_HTTP_LOC_CONF_OFFSET, 434 NGX_HTTP_LOC_CONF_OFFSET,
426 offsetof(ngx_http_proxy_loc_conf_t, upstream.hide_headers), 435 offsetof(ngx_http_proxy_loc_conf_t, upstream.hide_headers),
427 NULL }, 436 NULL },
437
438 { ngx_string("proxy_ignore_headers"),
439 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
440 ngx_conf_set_bitmask_slot,
441 NGX_HTTP_LOC_CONF_OFFSET,
442 offsetof(ngx_http_proxy_loc_conf_t, upstream.ignore_headers),
443 &ngx_http_proxy_ignore_headers_masks },
428 444
429 #if (NGX_HTTP_SSL) 445 #if (NGX_HTTP_SSL)
430 446
431 { ngx_string("proxy_ssl_session_reuse"), 447 { ngx_string("proxy_ssl_session_reuse"),
432 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, 448 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
1865 1881
1866 /* 1882 /*
1867 * set by ngx_pcalloc(): 1883 * set by ngx_pcalloc():
1868 * 1884 *
1869 * conf->upstream.bufs.num = 0; 1885 * conf->upstream.bufs.num = 0;
1886 * conf->upstream.ignore_headers = 0;
1870 * conf->upstream.next_upstream = 0; 1887 * conf->upstream.next_upstream = 0;
1871 * conf->upstream.use_stale_cache = 0; 1888 * conf->upstream.use_stale_cache = 0;
1872 * conf->upstream.temp_path = NULL; 1889 * conf->upstream.temp_path = NULL;
1873 * conf->upstream.hide_headers_hash = { NULL, 0 }; 1890 * conf->upstream.hide_headers_hash = { NULL, 0 };
1874 * conf->upstream.uri = { 0, NULL }; 1891 * conf->upstream.uri = { 0, NULL };
2070 2087
2071 return NGX_CONF_ERROR; 2088 return NGX_CONF_ERROR;
2072 } 2089 }
2073 2090
2074 2091
2092 ngx_conf_merge_bitmask_value(conf->upstream.ignore_headers,
2093 prev->upstream.ignore_headers,
2094 NGX_CONF_BITMASK_SET);
2095
2096
2075 ngx_conf_merge_bitmask_value(conf->upstream.next_upstream, 2097 ngx_conf_merge_bitmask_value(conf->upstream.next_upstream,
2076 prev->upstream.next_upstream, 2098 prev->upstream.next_upstream,
2077 (NGX_CONF_BITMASK_SET 2099 (NGX_CONF_BITMASK_SET
2078 |NGX_HTTP_UPSTREAM_FT_ERROR 2100 |NGX_HTTP_UPSTREAM_FT_ERROR
2079 |NGX_HTTP_UPSTREAM_FT_TIMEOUT)); 2101 |NGX_HTTP_UPSTREAM_FT_TIMEOUT));