Nginx : For Http range request ie 206 , custom headers are blocked in case of x-redirect chain -


we came across strange behavior when wanted etag propagated through x-redirect chain part of http response range request ie http 206.it seems nginx filters out additional costume headers / tmp variable part of final response through x-redirect non-200 response. kindly suggest workaround issue.

here's log data under debug mode normal vs range request clearing showing custom headers being filter out.

without range :  2013/04/16 04:08:22 [debug] 23457#0: *385 event timer del: 11: 1366110562151 2013/04/16 04:08:22 [debug] 23457#0: *385 event timer add: 11: 300000:1366110802151 2013/04/16 04:08:22 [debug] 23457#0: *385 http run request: "get_file?path=/shared/documents/loader.html" 2013/04/16 04:08:22 [debug] 23457#0: *385 http upstream check client, write event:1, "/v2_0/get_file" 2013/04/16 04:08:22 [debug] 23457#0: *385 http upstream recv(): -1 (11: resource temporarily unavailable) 2013/04/16 04:08:22 [debug] 23457#0: *385 http upstream request: "/v2_0/get_file?path=/shared/documents/loader.html" 2013/04/16 04:08:22 [debug] 23457#0: *385 http upstream process header 2013/04/16 04:08:22 [debug] 23457#0: *385 malloc: 000000000e8621c0:32768 2013/04/16 04:08:22 [debug] 23457#0: *385 recv: fd:11 1229 of 32646 2013/04/16 04:08:22 [debug] 23457#0: *385 http proxy status 200 "200 ok" 2013/04/16 04:08:22 [debug] 23457#0: *385 http proxy header: "last-modified: tue, 16 apr 2013 09:47:42 gmt" 2013/04/16 04:08:22 [debug] 23457#0: *385 http proxy header: "etag: 0853bce8-bf84-4cc4-9c7e-d4182bafafad" 2013/04/16 04:08:22 [debug] 23457#0: *385 http proxy header: "date: tue, 16 apr 2013 11:08:22 gmt" 2013/04/16 04:08:22 [debug] 23457#0: *385 http proxy header: "server: cherrypy/3.1.2" 2013/04/16 04:08:22 [debug] 23457#0: *385 http proxy header: "connection: close" 2013/04/16 04:08:22 [debug] 23457#0: *385 http proxy header: "content-disposition: attachment;filename="loader.html""  2013/04/16 04:08:22 [debug] 23457#0: *385 http script complex value 2013/04/16 04:08:22 [debug] 23457#0: *385 http script set $compressed 2013/04/16 04:08:22 [debug] 23457#0: *385 http script complex value 2013/04/16 04:08:22 [debug] 23457#0: *385 http script set $serve_decompressed 2013/04/16 04:08:22 [debug] 23457#0: *385 http script complex value 2013/04/16 04:08:22 [debug] 23457#0: *385 http script var: "0853bce8-bf84-4cc4-9c7e-d4182bafafad" 2013/04/16 04:08:22 [debug] 23457#0: *385 http script set $etag 2013/04/16 04:08:22 [debug] 23457#0: *385 http script complex value 2013/04/16 04:08:22 [debug] 23457#0: *385 http script var: "tue, 16 apr 2013 09:47:42 gmt" 2013/04/16 04:08:22 [debug] 23457#0: *385 http script set $last_modified 2013/04/16 04:08:22 [debug] 23457#0: *385 http script complex value 2013/04/16 04:08:22 [debug] 23457#0: *385 http script var: "205" 2013/04/16 04:08:22 [debug] 23457#0: *385 http script set $expected_size 2013/04/16 04:08:22 [debug] 23457#0: *385 http script complex value 2013/04/16 04:08:22 [debug] 23457#0: *385 http script var: "205" 2013/04/16 04:08:22 [debug] 23457#0: *385 http script set $actual_size -- 2013/04/16 04:08:22 [debug] 23457#0: *385 malloc: 000000000e906930:32768 2013/04/16 04:08:22 [debug] 23457#0: *385 posix_memalign: 000000000e90e940:4096 @16 2013/04/16 04:08:22 [debug] 23457#0: *385 recv: fd:11 350 of 32638 2013/04/16 04:08:22 [debug] 23457#0: *385 http proxy status 200 "200 ok" 2013/04/16 04:08:22 [debug] 23457#0: *385 http proxy header: "server: apache-coyote/1.1" 2013/04/16 04:08:22 [debug] 23457#0: *385 http proxy header: "accept-ranges: bytes" 2013/04/16 04:08:22 [debug] 23457#0: *385 http proxy header: "content-length: 205" 2013/04/16 04:08:22 [debug] 23457#0: *385 http proxy header: "date: tue, 16 apr 2013 11:08:22 gmt" 2013/04/16 04:08:22 [debug] 23457#0: *385 http proxy header: "connection: close" 2013/04/16 04:08:22 [debug] 23457#0: *385 http proxy header done 2013/04/16 04:08:22 [debug] 23457#0: *385 http script var: "0853bce8-bf84-4cc4-9c7e-d4182bafafad" 2013/04/16 04:08:22 [debug] 23457#0: *385 http script var: "0853bce8-bf84-4cc4-9c7e-d4182bafafad" 2013/04/16 04:08:22 [debug] 23457#0: *385 http script var: "tue, 16 apr 2013 09:47:42 gmt" 2013/04/16 04:08:22 [debug] 23457#0: *385 http/1.1 200 ok server: nginx/1.0.4 date: tue, 16 apr 2013 11:08:22 gmt content-type: text/html;charset=iso-8859-1 connection: keep-alive content-disposition: attachment;filename="loader.html" accept-ranges: none content-length: 205 etag: 0853bce8-bf84-4cc4-9c7e-d4182bafafad last-modified: tue, 16 apr 2013 09:47:42 gmt =================================================================================   range :  2013/04/16 04:07:35 [debug] 23457#0: *373 event timer del: 11: 1366110515893 2013/04/16 04:07:35 [debug] 23457#0: *373 event timer add: 11: 300000:1366110755894 2013/04/16 04:07:35 [debug] 23457#0: *373 http run request: "/v2_0/get_file?path=/shared/documents/loader.html" 2013/04/16 04:07:35 [debug] 23457#0: *373 http upstream check client, write event:1, "/v2_0/get_file" 2013/04/16 04:07:35 [debug] 23457#0: *373 http upstream recv(): -1 (11: resource temporarily unavailable) 2013/04/16 04:07:35 [debug] 23457#0: *373 http upstream request: "/v2_0/get_file?path=/shared/documents/loader.html" 2013/04/16 04:07:35 [debug] 23457#0: *373 http upstream process header 2013/04/16 04:07:35 [debug] 23457#0: *373 malloc: 000000000e8621c0:32768 2013/04/16 04:07:35 [debug] 23457#0: *373 recv: fd:11 1258 of 32646 2013/04/16 04:07:35 [debug] 23457#0: *373 http proxy status 200 "200 ok" 2013/04/16 04:07:35 [debug] 23457#0: *373 http proxy header: "etag: 0853bce8-bf84-4cc4-9c7e-d4182bafafad" 2013/04/16 04:07:35 [debug] 23457#0: *373 http proxy header: "date: tue, 16 apr 2013 11:07:35 gmt" 2013/04/16 04:07:35 [debug] 23457#0: *373 http proxy header: "server: cherrypy/3.1.2" 2013/04/16 04:07:35 [debug] 23457#0: *373 http proxy header: "connection: close" 2013/04/16 04:07:35 [debug] 23457#0: *373 http proxy header: "content-disposition: attachment;filename="loader.html""   2013/04/16 04:07:35 [debug] 23457#0: *373 http script complex value 2013/04/16 04:07:35 [debug] 23457#0: *373 http script set $compressed 2013/04/16 04:07:35 [debug] 23457#0: *373 http script complex value 2013/04/16 04:07:35 [debug] 23457#0: *373 http script set $serve_decompressed 2013/04/16 04:07:35 [debug] 23457#0: *373 http script complex value 2013/04/16 04:07:35 [debug] 23457#0: *373 http script var: "0853bce8-bf84-4cc4-9c7e-d4182bafafad" 2013/04/16 04:07:35 [debug] 23457#0: *373 http script set $etag 2013/04/16 04:07:35 [debug] 23457#0: *373 http script complex value 2013/04/16 04:07:35 [debug] 23457#0: *373 http script var: "tue, 16 apr 2013 09:47:42 gmt" 2013/04/16 04:07:35 [debug] 23457#0: *373 http script set $last_modified 2013/04/16 04:07:35 [debug] 23457#0: *373 http script complex value 2013/04/16 04:07:35 [debug] 23457#0: *373 http script var: "205" 2013/04/16 04:07:35 [debug] 23457#0: *373 http script set $expected_size 2013/04/16 04:07:35 [debug] 23457#0: *373 http script complex value 2013/04/16 04:07:35 [debug] 23457#0: *373 http script var: "205" 2013/04/16 04:07:35 [debug] 23457#0: *373 http script set $actual_size  2013/04/16 04:05:18 [debug] 23457#0: *352 http proxy status 206 "206 partial content" 2013/04/16 04:05:18 [debug] 23457#0: *352 http proxy header: "server: apache-coyote/1.1" 2013/04/16 04:05:18 [debug] 23457#0: *352 http proxy header: "accept-ranges: bytes" 2013/04/16 04:05:18 [debug] 23457#0: *352 http proxy header: "content-range: bytes 10-20/205" 2013/04/16 04:05:18 [debug] 23457#0: *352 http proxy header: "content-length: 11" 2013/04/16 04:05:18 [debug] 23457#0: *352 http proxy header: "date: tue, 16 apr 2013 11:05:18 gmt" 2013/04/16 04:05:18 [debug] 23457#0: *352 http proxy header: "connection: close" 2013/04/16 04:05:18 [debug] 23457#0: *352 http proxy header done 2013/04/16 04:05:18 [debug] 23457#0: *352 http/1.1 206 partial content server: nginx/1.0.4`enter code here` date: tue, 16 apr 2013 11:05:18 gmt content-type: text/html;charset=iso-8859-1 connection: keep-alive content-disposition: attachment;filename="loader.html" accept-ranges: none content-range: bytes 10-20/205 content-length: 11 

both of responses have

accept-ranges: none 

indicates server doesn't support range request.

reference: http://www.w3.org/protocols/rfc2616/rfc2616-sec14.html

  servers not accept kind of range request   resource may send        accept-ranges: none    advise client not attempt range request. 

dont know nginx config. because http 1.1 supports range request, guess might have missed directive:

 proxy_http_version 1.1; 

nginx proxy module default uses http 1.0. however, if upstream server supports http 1.1 (it should), it's recommended use 1.1 better performance. see reference detail: http://wiki.nginx.org/httpproxymodule#proxy_http_version


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -