We're using nginx as a proxy, and I want to limit the download rate of
certain proxied pages/files depending on a header potentially set by the
backend server. I'm trying something like:
location ^~ / {
set $slowrate $upstream_http_x_rate_limit;
if ($slowrate) {
set $limit_rate $slowrate;
}
rewrite (.*) /http/$host$1 break;
proxy_pass http://backend/;
proxy_hide_header X-Rate-Limit;
....
}
And then setting the X-Rate-Limit header on the backend response, but
that doesn't seem to work.
So I tried even simpler, allowing just a simple "make this slow" header
setting.
location ^~ / {
set $slowrate $upstream_http_x_rate_limit;
if ($slowrate) {
limit_rate 100;
}
rewrite (.*) /http/$host$1 break;
proxy_pass http://backend/;
proxy_hide_header X-Rate-Limit;
....
}
Yes, I really wanted to try just 100 bytes/second. But that didn't work
either.
Is there a way of doing this?
Rob
Rob Mueller
robm@fastmail.fm
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx