Skip to content

Instantly share code, notes, and snippets.

@svdgraaf
Created September 20, 2010 07:36
Show Gist options
  • Save svdgraaf/587543 to your computer and use it in GitHub Desktop.
Save svdgraaf/587543 to your computer and use it in GitHub Desktop.
nginx byte request on proxied file
server {
listen *:80;
location = /crossdomain.xml {
root /var/www/html/;
}
location = /test.html {
root /var/www/html/;
}
location / {
root /data/www;
error_page 404 = /fetch$uri;
}
location /fetch {
internal;
proxy_pass http://127.0.0.1:50000;
proxy_store on;
proxy_store_access user:rw group:rw all:r;
proxy_temp_path /data/temp;
alias /data/www;
}
location /test {
bytes on;
if ($http_range) {
set $args $http_range;
}
rewrite /test/(.+)$ /$1 break;
proxy_pass http://127.0.0.1:50000;
}
location /m {
#bytes on;
rewrite /m/(.+)$ /$1 break;
proxy_pass http://127.0.0.1:50000;
}
}
# using: ngx_http_bytes_filter_module
location / {
bytes on;
if ($http_range) {
set $args $http_range;
}
proxy_pass http://127.0.0.1:50000;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment