lx
November 26, 2019 06:26AM
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
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

upstream_response_length and upstream_addr can't work

lx November 26, 2019 06:26AM

Re: upstream_response_length and upstream_addr can't work

Roman Arutyunyan November 26, 2019 08:12AM

Re: upstream_response_length and upstream_addr can't work

lx November 26, 2019 08:16PM

Re: upstream_response_length and upstream_addr can't work

Roman Arutyunyan November 27, 2019 05:22AM

Re: upstream_response_length and upstream_addr can't work

lx November 28, 2019 05:42AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 182
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready