﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1304	proxy_cache not support slice	yan.sheng.upai.com@…		"
== config: ==

proxy_cache_path /root/cjhust/cache levels=1:2 keys_zone=cjhust:100m inactive=2h max_size=10g;

server {
    listen 7000;

    location / {
        expires 30s;
        root html;
    }
}


server {
    listen 8001;
    proxy_cache cjhust;

    location / {
        slice 256k;
        proxy_set_header range $slice_range;
        proxy_pass http://127.0.0.1:7000;
    }
}



== first test: result is OK ==
#curl http://127.0.0.1:8001/512K.mp3 -r 1-5 -v
* About to connect() to 127.0.0.1 port 8001 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8001 (#0)
> GET /512K.mp3 HTTP/1.1
> Range: bytes=1-5
> User-Agent: curl/7.29.0
> Host: 127.0.0.1:8001
> Accept: */*
> 
< HTTP/1.1 206 Partial Content
< Server: nginx/1.11.6
< Date: Thu, 29 Jun 2017 02:56:17 GMT
< Content-Type: audio/mpeg
'''< Content-Length: 5'''
< Connection: keep-alive
< Last-Modified: Thu, 22 Jun 2017 06:53:07 GMT
< ETag: ""594b6953-7d000""
< Expires: Thu, 29 Jun 2017 02:56:47 GMT
< Cache-Control: max-age=30
< Content-Range: bytes 1-5/512000
< 
* Connection #0 to host 127.0.0.1 left intact



== second test: result is ERROR ==
#curl http://127.0.0.1:8001/512K.mp3 -r 1-5 -v
* About to connect() to 127.0.0.1 port 8001 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8001 (#0)
> GET /512K.mp3 HTTP/1.1
> Range: bytes=1-5
> User-Agent: curl/7.29.0
> Host: 127.0.0.1:8001
> Accept: */*
> 
< HTTP/1.1 206 Partial Content
< Server: nginx/1.11.6
< Date: Thu, 29 Jun 2017 02:56:24 GMT
< Content-Type: audio/mpeg
'''< Content-Length: 262144'''
< Connection: keep-alive
< Last-Modified: Thu, 22 Jun 2017 06:53:07 GMT
< ETag: ""594b6953-7d000""
< Expires: Thu, 29 Jun 2017 02:56:47 GMT
< Cache-Control: max-age=30
< Content-Range: bytes 0-262143/512000
< 
* Connection #0 to host 127.0.0.1 left intact"	defect	closed	minor		other	1.11.x	invalid			 #1 SMP Thu Jun 23 17:05:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux	nginx version: nginx/1.11.6
