user nginx;
daemon off;
master_process off;
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    proxy_cache_path    /data/cachefiles/ levels=1:2 keys_zone=cachefiles:500m max_size=50g inactive=180d;
    proxy_cache cachefiles;
    proxy_temp_path /data/temp;

    server {
        listen       0.0.0.0:80;
        server_name  localhost;

        proxy_connect_timeout   60s;
        proxy_read_timeout      120s;
        proxy_http_version      1.1;

        error_page 500 502 503 504  /server-error/;

        location /server-error/ {
                expires 30d;
                root   /usr/share/nginx/html;
                index  index.html index.htm;
        }

        location / {
                slice   1m;
                proxy_cache_key         "$host$uri$slice_range";
                expires                 off;
                proxy_cache_valid       any 360s;
                proxy_pass              http://origin_ip_goes_here$request_uri;
                proxy_set_header        Host "my_origin_hostname";
                proxy_set_header        Range $slice_range;
        }
    }
}
