comparison src/http/ngx_http_upstream.c @ 3246:eb555a9a57d4 stable-0.7

merge r3004, r3005, r3006: various header fixes: *) allow to proxy_pass_header/fastcgi_pass_header "X-Accel-Redirect", "X-Accel-Limit-Rate", "X-Accel-Buffering", and "X-Accel-Charset" *) fix handling "Last-Modified" and "Accept-Ranges" for upstream responses *) clear "Accept-Ranges" for SSI responses
author Igor Sysoev <igor@sysoev.ru>
date Mon, 26 Oct 2009 17:13:44 +0000
parents 61962127b166
children 1f3cd08ebb82
comparison
equal deleted inserted replaced
3245:61962127b166 3246:eb555a9a57d4
228 ngx_http_upstream_copy_header_line, 0, 0 }, 228 ngx_http_upstream_copy_header_line, 0, 0 },
229 229
230 { ngx_string("X-Accel-Redirect"), 230 { ngx_string("X-Accel-Redirect"),
231 ngx_http_upstream_process_header_line, 231 ngx_http_upstream_process_header_line,
232 offsetof(ngx_http_upstream_headers_in_t, x_accel_redirect), 232 offsetof(ngx_http_upstream_headers_in_t, x_accel_redirect),
233 ngx_http_upstream_ignore_header_line, 0, 0 }, 233 ngx_http_upstream_copy_header_line, 0, 0 },
234 234
235 { ngx_string("X-Accel-Limit-Rate"), 235 { ngx_string("X-Accel-Limit-Rate"),
236 ngx_http_upstream_process_limit_rate, 0, 236 ngx_http_upstream_process_limit_rate, 0,
237 ngx_http_upstream_ignore_header_line, 0, 0 }, 237 ngx_http_upstream_copy_header_line, 0, 0 },
238 238
239 { ngx_string("X-Accel-Buffering"), 239 { ngx_string("X-Accel-Buffering"),
240 ngx_http_upstream_process_buffering, 0, 240 ngx_http_upstream_process_buffering, 0,
241 ngx_http_upstream_ignore_header_line, 0, 0 }, 241 ngx_http_upstream_copy_header_line, 0, 0 },
242 242
243 { ngx_string("X-Accel-Charset"), 243 { ngx_string("X-Accel-Charset"),
244 ngx_http_upstream_process_charset, 0, 244 ngx_http_upstream_process_charset, 0,
245 ngx_http_upstream_ignore_header_line, 0, 0 }, 245 ngx_http_upstream_copy_header_line, 0, 0 },
246 246
247 #if (NGX_HTTP_GZIP) 247 #if (NGX_HTTP_GZIP)
248 { ngx_string("Content-Encoding"), 248 { ngx_string("Content-Encoding"),
249 ngx_http_upstream_process_header_line, 249 ngx_http_upstream_process_header_line,
250 offsetof(ngx_http_upstream_headers_in_t, content_encoding), 250 offsetof(ngx_http_upstream_headers_in_t, content_encoding),
3338 return NGX_ERROR; 3338 return NGX_ERROR;
3339 } 3339 }
3340 3340
3341 *ho = *h; 3341 *ho = *h;
3342 3342
3343 r->headers_out.last_modified = ho;
3344
3343 #if (NGX_HTTP_CACHE) 3345 #if (NGX_HTTP_CACHE)
3344 3346
3345 if (r->upstream->cacheable) { 3347 if (r->upstream->cacheable) {
3346 r->headers_out.last_modified = ho;
3347 r->headers_out.last_modified_time = ngx_http_parse_time(h->value.data, 3348 r->headers_out.last_modified_time = ngx_http_parse_time(h->value.data,
3348 h->value.len); 3349 h->value.len);
3349 } 3350 }
3350 3351
3351 #endif 3352 #endif
3464 if (ho == NULL) { 3465 if (ho == NULL) {
3465 return NGX_ERROR; 3466 return NGX_ERROR;
3466 } 3467 }
3467 3468
3468 *ho = *h; 3469 *ho = *h;
3470
3471 r->headers_out.accept_ranges = ho;
3469 3472
3470 return NGX_OK; 3473 return NGX_OK;
3471 } 3474 }
3472 3475
3473 3476