Mercurial > hg > nginx-vendor-current
comparison src/http/modules/ngx_http_fastcgi_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 | bc110f60c0de |
children | b6a5942a4e6a |
comparison
equal
deleted
inserted
replaced
583:39e50617266a | 584:016632f0fb18 |
---|---|
181 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, | 181 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, |
182 { ngx_null_string, 0 } | 182 { ngx_null_string, 0 } |
183 }; | 183 }; |
184 | 184 |
185 | 185 |
186 static ngx_conf_bitmask_t ngx_http_fastcgi_ignore_headers_masks[] = { | |
187 { ngx_string("X-Accel-Redirect"), NGX_HTTP_UPSTREAM_IGN_XA_REDIRECT }, | |
188 { ngx_string("X-Accel-Expires"), NGX_HTTP_UPSTREAM_IGN_XA_EXPIRES }, | |
189 { ngx_string("Expires"), NGX_HTTP_UPSTREAM_IGN_EXPIRES }, | |
190 { ngx_string("Cache-Control"), NGX_HTTP_UPSTREAM_IGN_CACHE_CONTROL }, | |
191 { ngx_null_string, 0 } | |
192 }; | |
193 | |
194 | |
195 ngx_module_t ngx_http_fastcgi_module; | 186 ngx_module_t ngx_http_fastcgi_module; |
196 | 187 |
197 | 188 |
198 static ngx_command_t ngx_http_fastcgi_commands[] = { | 189 static ngx_command_t ngx_http_fastcgi_commands[] = { |
199 | 190 |
428 { ngx_string("fastcgi_ignore_headers"), | 419 { ngx_string("fastcgi_ignore_headers"), |
429 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, | 420 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, |
430 ngx_conf_set_bitmask_slot, | 421 ngx_conf_set_bitmask_slot, |
431 NGX_HTTP_LOC_CONF_OFFSET, | 422 NGX_HTTP_LOC_CONF_OFFSET, |
432 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.ignore_headers), | 423 offsetof(ngx_http_fastcgi_loc_conf_t, upstream.ignore_headers), |
433 &ngx_http_fastcgi_ignore_headers_masks }, | 424 &ngx_http_upstream_ignore_headers_masks }, |
434 | 425 |
435 { ngx_string("fastcgi_catch_stderr"), | 426 { ngx_string("fastcgi_catch_stderr"), |
436 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, | 427 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, |
437 ngx_conf_set_str_array_slot, | 428 ngx_conf_set_str_array_slot, |
438 NGX_HTTP_LOC_CONF_OFFSET, | 429 NGX_HTTP_LOC_CONF_OFFSET, |
521 ngx_null_string | 512 ngx_null_string |
522 }; | 513 }; |
523 | 514 |
524 | 515 |
525 #if (NGX_HTTP_CACHE) | 516 #if (NGX_HTTP_CACHE) |
526 | |
527 static ngx_str_t ngx_http_fastcgi_hide_cache_headers[] = { | |
528 ngx_string("Status"), | |
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 }; | |
538 | |
539 | 517 |
540 static ngx_keyval_t ngx_http_fastcgi_cache_headers[] = { | 518 static ngx_keyval_t ngx_http_fastcgi_cache_headers[] = { |
541 { ngx_string("HTTP_IF_MODIFIED_SINCE"), ngx_string("") }, | 519 { ngx_string("HTTP_IF_MODIFIED_SINCE"), ngx_string("") }, |
542 { ngx_string("HTTP_IF_UNMODIFIED_SINCE"), ngx_string("") }, | 520 { ngx_string("HTTP_IF_UNMODIFIED_SINCE"), ngx_string("") }, |
543 { ngx_string("HTTP_IF_NONE_MATCH"), ngx_string("") }, | 521 { ngx_string("HTTP_IF_NONE_MATCH"), ngx_string("") }, |
2032 ngx_http_fastcgi_loc_conf_t *conf = child; | 2010 ngx_http_fastcgi_loc_conf_t *conf = child; |
2033 | 2011 |
2034 u_char *p; | 2012 u_char *p; |
2035 size_t size; | 2013 size_t size; |
2036 uintptr_t *code; | 2014 uintptr_t *code; |
2037 ngx_str_t *hide; | |
2038 ngx_uint_t i; | 2015 ngx_uint_t i; |
2039 ngx_array_t headers_names; | 2016 ngx_array_t headers_names; |
2040 ngx_keyval_t *src; | 2017 ngx_keyval_t *src; |
2041 ngx_hash_key_t *hk; | 2018 ngx_hash_key_t *hk; |
2042 ngx_hash_init_t hash; | 2019 ngx_hash_init_t hash; |
2258 | 2235 |
2259 hash.max_size = 512; | 2236 hash.max_size = 512; |
2260 hash.bucket_size = ngx_align(64, ngx_cacheline_size); | 2237 hash.bucket_size = ngx_align(64, ngx_cacheline_size); |
2261 hash.name = "fastcgi_hide_headers_hash"; | 2238 hash.name = "fastcgi_hide_headers_hash"; |
2262 | 2239 |
2263 #if (NGX_HTTP_CACHE) | |
2264 | |
2265 hide = conf->upstream.cache ? ngx_http_fastcgi_hide_cache_headers: | |
2266 ngx_http_fastcgi_hide_headers; | |
2267 #else | |
2268 | |
2269 hide = ngx_http_fastcgi_hide_headers; | |
2270 | |
2271 #endif | |
2272 | |
2273 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream, | 2240 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream, |
2274 &prev->upstream, hide, &hash) | 2241 &prev->upstream, ngx_http_fastcgi_hide_headers, &hash) |
2275 != NGX_OK) | 2242 != NGX_OK) |
2276 { | 2243 { |
2277 return NGX_CONF_ERROR; | 2244 return NGX_CONF_ERROR; |
2278 } | 2245 } |
2279 | 2246 |