Exempt localhost and local networks from rate limits in nginx.conf

A user recently reported they were rate limiting from querying their own
node - this PR exempts all LAN addresses from rate limits

Needs testing on Umbrel / RaspiBlitz / MyNode before merging
This commit is contained in:
wiz 2021-10-15 12:32:37 +09:00
parent 6f9762d50b
commit b3e47e1438
No known key found for this signature in database
GPG Key ID: A394E332255A6173

View File

@ -54,10 +54,16 @@ http {
proxy_cache_path /var/cache/nginx keys_zone=cache:20m levels=1:2 inactive=600s max_size=500m;
types_hash_max_size 2048;
# exempt localhost from rate limit
# exempt localhost and local networks from rate limits
geo $limited_ip {
default 1;
127.0.0.1 0;
127.0.0.0/8 0;
10.0.0.0/8 0;
172.16.0.0/12 0;
192.168.0.0/16 0;
169.254.0.0/16 0;
fc00::/7 0;
fe80::/10 0;
}
map $limited_ip $limited_ip_key {
1 $binary_remote_addr;