Got nginx serving several big files. Users get access through basic authentication. htpasswd I want to curtail simultaneous download of files to 5 connections max PER USER. There are more than 1 user getting access through 1 IP address so it is not possible to do it by IP.
I've tried following:
map "$remote_user" $num {
default 5
}
server {
location /source {
root /home/frog/source/;
auth_basic "Login";
auth_basic_user_file /home/frog/.htpasswd;
set $limit_conn $num;
}
But it won't limit it. I still cat open more than five connections simultaneously. Help!