Nginx限制除本地主机IP以外的所有主机的速率';s
因此,在Nginx中,我的位置配置允许MP4流,如下所示,但我想将速率限制为除我指定的特定本地主机IP之外的所有流量 因此,我不希望有传输限制的IP地址如下:Nginx限制除本地主机IP以外的所有主机的速率';s,nginx,localhost,limit,Nginx,Localhost,Limit,因此,在Nginx中,我的位置配置允许MP4流,如下所示,但我想将速率限制为除我指定的特定本地主机IP之外的所有流量 因此,我不希望有传输限制的IP地址如下: 172.16.0.1 172.16.0.2 172.16.0.3 172.16.0.4 172.16.0.5 172.16.0.6 etc etc MP4流的Nginx配置: location ~ \.mp4$ { mp4; limit_rate_after 1m; limit_rate 1m; root '//172.16.0.1
172.16.0.1
172.16.0.2
172.16.0.3
172.16.0.4
172.16.0.5
172.16.0.6
etc etc
MP4流的Nginx配置:
location ~ \.mp4$ {
mp4;
limit_rate_after 1m;
limit_rate 1m;
root '//172.16.0.1/Storage1/server/domain/public_www';
expires max;
valid_referers none blocked domain.com *.domain.com;
if ($invalid_referer) {
return 403;
}
}
是的,关于我应该做什么配置调整,或者更改/做什么,只允许我的本地主机IP接收mp4文件而不受限制率配置的限制,任何帮助都将非常好:)在Nginx config的HTTP块中
geo $remove_rate_limit {
default 0;
172.16.0.0/24 1;
}
location ~ \.mp4$ {
mp4;
limit_rate_after 1m; #All users will be limited
limit_rate 1m; #All users will be limited
#Order this after the limit_rate to remove the limit for specific IP's
if ($remove_rate_limit) { #If IP matches
limit_rate_after 0; #Make 0 what is default setting for no limit.
limit_rate 0; #Make 0 what is default setting for no limit.
}
root '//172.16.0.1/Storage1/server/domain/public_www';
expires max;
valid_referers none blocked domain.com *.domain.com;
if ($invalid_referer) {
return 403;
}
}
在Nginx Config的服务器位置块中
geo $remove_rate_limit {
default 0;
172.16.0.0/24 1;
}
location ~ \.mp4$ {
mp4;
limit_rate_after 1m; #All users will be limited
limit_rate 1m; #All users will be limited
#Order this after the limit_rate to remove the limit for specific IP's
if ($remove_rate_limit) { #If IP matches
limit_rate_after 0; #Make 0 what is default setting for no limit.
limit_rate 0; #Make 0 what is default setting for no limit.
}
root '//172.16.0.1/Storage1/server/domain/public_www';
expires max;
valid_referers none blocked domain.com *.domain.com;
if ($invalid_referer) {
return 403;
}
}