Mercurial > hg > nginx-mail
comparison src/http/modules/ngx_http_uwsgi_module.c @ 627: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
626:39e50617266a | 627:016632f0fb18 |
---|---|
81 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, | 81 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, |
82 { ngx_null_string, 0 } | 82 { ngx_null_string, 0 } |
83 }; | 83 }; |
84 | 84 |
85 | 85 |
86 static ngx_conf_bitmask_t ngx_http_uwsgi_ignore_headers_masks[] = { | |
87 { ngx_string("X-Accel-Redirect"), NGX_HTTP_UPSTREAM_IGN_XA_REDIRECT }, | |
88 { ngx_string("X-Accel-Expires"), NGX_HTTP_UPSTREAM_IGN_XA_EXPIRES }, | |
89 { ngx_string("Expires"), NGX_HTTP_UPSTREAM_IGN_EXPIRES }, | |
90 { ngx_string("Cache-Control"), NGX_HTTP_UPSTREAM_IGN_CACHE_CONTROL }, | |
91 { ngx_null_string, 0 } | |
92 }; | |
93 | |
94 | |
95 ngx_module_t ngx_http_uwsgi_module; | 86 ngx_module_t ngx_http_uwsgi_module; |
96 | 87 |
97 | 88 |
98 static ngx_command_t ngx_http_uwsgi_commands[] = { | 89 static ngx_command_t ngx_http_uwsgi_commands[] = { |
99 | 90 |
328 { ngx_string("uwsgi_ignore_headers"), | 319 { ngx_string("uwsgi_ignore_headers"), |
329 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, | 320 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, |
330 ngx_conf_set_bitmask_slot, | 321 ngx_conf_set_bitmask_slot, |
331 NGX_HTTP_LOC_CONF_OFFSET, | 322 NGX_HTTP_LOC_CONF_OFFSET, |
332 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ignore_headers), | 323 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ignore_headers), |
333 &ngx_http_uwsgi_ignore_headers_masks }, | 324 &ngx_http_upstream_ignore_headers_masks }, |
334 | 325 |
335 ngx_null_command | 326 ngx_null_command |
336 }; | 327 }; |
337 | 328 |
338 | 329 |
377 }; | 368 }; |
378 | 369 |
379 | 370 |
380 #if (NGX_HTTP_CACHE) | 371 #if (NGX_HTTP_CACHE) |
381 | 372 |
382 static ngx_str_t ngx_http_uwsgi_hide_cache_headers[] = { | |
383 ngx_string("X-Accel-Expires"), | |
384 ngx_string("X-Accel-Redirect"), | |
385 ngx_string("X-Accel-Limit-Rate"), | |
386 ngx_string("X-Accel-Buffering"), | |
387 ngx_string("X-Accel-Charset"), | |
388 ngx_string("Set-Cookie"), | |
389 ngx_string("P3P"), | |
390 ngx_null_string | |
391 }; | |
392 | |
393 | |
394 static ngx_keyval_t ngx_http_uwsgi_cache_headers[] = { | 373 static ngx_keyval_t ngx_http_uwsgi_cache_headers[] = { |
395 { ngx_string("HTTP_IF_MODIFIED_SINCE"), ngx_string("") }, | 374 { ngx_string("HTTP_IF_MODIFIED_SINCE"), ngx_string("") }, |
396 { ngx_string("HTTP_IF_UNMODIFIED_SINCE"), ngx_string("") }, | 375 { ngx_string("HTTP_IF_UNMODIFIED_SINCE"), ngx_string("") }, |
397 { ngx_string("HTTP_IF_NONE_MATCH"), ngx_string("") }, | 376 { ngx_string("HTTP_IF_NONE_MATCH"), ngx_string("") }, |
398 { ngx_string("HTTP_IF_MATCH"), ngx_string("") }, | 377 { ngx_string("HTTP_IF_MATCH"), ngx_string("") }, |
1111 ngx_http_uwsgi_loc_conf_t *conf = child; | 1090 ngx_http_uwsgi_loc_conf_t *conf = child; |
1112 | 1091 |
1113 u_char *p; | 1092 u_char *p; |
1114 size_t size; | 1093 size_t size; |
1115 uintptr_t *code; | 1094 uintptr_t *code; |
1116 ngx_str_t *hide; | |
1117 ngx_uint_t i; | 1095 ngx_uint_t i; |
1118 ngx_array_t headers_names; | 1096 ngx_array_t headers_names; |
1119 ngx_keyval_t *src; | 1097 ngx_keyval_t *src; |
1120 ngx_hash_key_t *hk; | 1098 ngx_hash_key_t *hk; |
1121 ngx_hash_init_t hash; | 1099 ngx_hash_init_t hash; |
1332 | 1310 |
1333 hash.max_size = 512; | 1311 hash.max_size = 512; |
1334 hash.bucket_size = ngx_align(64, ngx_cacheline_size); | 1312 hash.bucket_size = ngx_align(64, ngx_cacheline_size); |
1335 hash.name = "uwsgi_hide_headers_hash"; | 1313 hash.name = "uwsgi_hide_headers_hash"; |
1336 | 1314 |
1337 #if (NGX_HTTP_CACHE) | |
1338 | |
1339 hide = conf->upstream.cache ? ngx_http_uwsgi_hide_cache_headers: | |
1340 ngx_http_uwsgi_hide_headers; | |
1341 #else | |
1342 | |
1343 hide = ngx_http_uwsgi_hide_headers; | |
1344 | |
1345 #endif | |
1346 | |
1347 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream, | 1315 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream, |
1348 &prev->upstream, hide, &hash) | 1316 &prev->upstream, ngx_http_uwsgi_hide_headers, &hash) |
1349 != NGX_OK) | 1317 != NGX_OK) |
1350 { | 1318 { |
1351 return NGX_CONF_ERROR; | 1319 return NGX_CONF_ERROR; |
1352 } | 1320 } |
1353 | 1321 |