upstream_response_length and upstream_addr can't work

lx lxlenovostar at gmail.com
Tue Nov 26 11:24:00 UTC 2019


hi all:
     When I use module of slice,  upstream_response_length and
upstream_addr can't work.
nginx.conf :
#########################################################################
  include       mime.types;
    default_type  application/octet-stream;

    log_format  main
'$status^$scheme^$request^$body_bytes_sent^$request_time^$upstream_cache_status^$remote_addr^$http_referer^$http_user_agent^$content_type^$http_range^$cookie_name^$upstream_addr^$upstream_response_time^$upstream_bytes_received^$upstream_response_length^[$time_local]';


    access_log  logs/access.log  main;
    rewrite_log on;

    sendfile        on;
    aio             threads;

    keepalive_timeout  65;

 if ($uri ~ ^/([a-zA-Z0-9\.]+)/([a-zA-Z0-9\.]+)/(.*)) {
      set $cdn $1;
      set $new_host $2;
     set $new_uri  $3;
}

        location / {
            slice 1m;
            proxy_cache_lock on;
            proxy_cache my_cache;
            proxy_cache_key $uri$is_args$args$slice_range;
            proxy_set_header Range $slice_range;
           proxy_cache_valid 200 206 24h;
           proxy_pass http://$cdn/$new_uri;
        }
#########################################################################
I Initiate a rang htttp request, for example
#########################################################################
 curl -o result -H 'Range: bytes=2001-4932000' "
http://127.0.0.1:64002/A.com/B.com/appstore/developer/soft/20191008/201910081449521157660.patch
"
#########################################################################
upstream_response_length and upstream_bytes_received is just 1 MB, not
4.9MB.  I find nginx build 5 http request to A.com by tcpdump, and nginx
implement slice by subrequest.

This is why? How to fix it?

Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20191126/323073d8/attachment.htm>


More information about the nginx mailing list