Opened 11 years ago

Closed 11 years ago

#258 closed defect (invalid)

proxy_store does not always stores the requested file.

Reported by: Rainer Schuth Owned by:
Priority: minor Milestone:
Component: nginx-module Version: 1.2.x
Keywords: HttpProxyModule Cc:
uname -a: Linux interceptor 3.0.6-gentoo #1 SMP Tue Dec 20 17:56:00 CET 2011 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz GenuineIntel GNU/Linux
nginx -V: nginx version: nginx/1.2.5
TLS SNI support enabled
configure arguments: --prefix=/usr --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error_log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --with-cc-opt=-I/usr/include --with-ld-opt=-L/usr/lib --http-log-path=/var/log/nginx/access_log --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-scgi-temp-path=/var/tmp/nginx/scgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --with-ipv6 --with-pcre --with-http_flv_module --with-http_geoip_module --with-http_image_filter_module --with-http_mp4_module --with-http_secure_link_module --with-http_stub_status_module --with-http_realip_module --add-module=/var/tmp/portage/www-servers/nginx-1.2.5-r1/work/ngx_cache_purge-1.6 --add-module=/var/tmp/portage/www-servers/nginx-1.2.5-r1/work/ngx_slowfs_cache-1.9 --add-module=/var/tmp/portage/www-servers/nginx-1.2.5-r1/work/nginx-rtmp-module-0.7.4/hls --add-module=/var/tmp/portage/www-servers/nginx-1.2.5-r1/work/nginx-rtmp-module-0.7.4 --with-http_ssl_module --without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module --user=nginx --group=nginx

Description

The proxy_store directive do not save the requested file if the file is not requested with a web browser.

This occurs when playing a HTTP Live Stream playlist with the VLC (2.0.3) Player.
Reproducible with Mplayer (1.0_rc4_p20110322-r1).
If mplayer request the file directly, nginx stores the file correctly.
With Totem Media Player (2.32.0-r2) works.

If I try to get the files listed in the playlist with a Browser or cmdline client (Lynx,Firefox,Opera,Wget) nginx stores the file locally, as it should.

The client I am using is a gentoo system with:
"Linux reipad 3.5.2-gentoo #6 SMP Thu Nov 1 08:29:16 CET 2012 x86_64 Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz GenuineIntel GNU/Linux"

#nginx.conf

location ~* /hls/ondemand(/.*)\.ts {

try_files $uri @ondemand;

}
location ~* /hls/m3u8(/.*)\.m3u8 {

try_files $uri @ondemand;

}

location @ondemand {

internal;
proxy_pass http://upstream_backend_storage;
proxy_store on;
proxy_store_access user:rw group:rw all:r;
proxy_temp_path /var/www;

}

#From the Log:
$IP - - [16/Dec/2012:20:32:31 +0100] "GET /hls/ondemand/saal1_hq-2011.12.29-15_03_36.ts HTTP/1.1" 206 580732 "-" "VLC/2.0.3 LibVLC/2.0.3"
$IP - - [16/Dec/2012:20:32:38 +0100] "GET /hls/ondemand/saal1_hq-2011.12.29-15_39_57.ts HTTP/1.0" 416 206 "-" "MPlayer SVN-r33094-4.5.3"
$IP - - [16/Dec/2012:20:32:39 +0100] "GET /hls/ondemand/saal1_hq-2011.12.29-15_03_44.ts HTTP/1.1" 206 579228 "-" "VLC/2.0.3 LibVLC/2.0.3"
$IP - - [16/Dec/2012:20:32:40 +0100] "GET /hls/ondemand/saal1_hq-2011.12.29-15_39_57.ts HTTP/1.0" 200 571520 "-" "MPlayer SVN-r33094-4.5.3"
$IP - - [16/Dec/2012:20:32:40 +0100] "GET /hls/ondemand/saal1_hq-2011.12.29-15_39_57.ts HTTP/1.0" 200 571520 "-" "MPlayer SVN-r33094-4.5.3"
$IP - - [16/Dec/2012:20:33:35 +0100] "GET /hls/ondemand/saal1_hq-2011.12.29-15_39_57.ts HTTP/1.1" 200 571520 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"

Change History (2)

comment:1 by Rainer Schuth, 11 years ago

Under a Apple System with the Media Player works correctly.

#Log
$IP - - [16/Dec/2012:20:39:57 +0100] "GET /hls/ondemand/saal1_hq-2011.12.29-15_18_57.ts HTTP/1.1" 200 901460 "-" "AppleCoreMedia/1.0.0.10A523 (iPhone; U; CPU OS 6_0_1 like Mac OS X; en_us)"

comment:2 by Valentin V. Bartenev, 11 years ago

Resolution: invalid
Status: newclosed

Your upstream server responds with 206 (partial content), while proxy_store only works for successful responses with the full length of the resource (i.e. 200).

Note: See TracTickets for help on using tickets.