From b3e47e14386d1a604fda285125b9d7f4e6fafe39 Mon Sep 17 00:00:00 2001 From: wiz Date: Fri, 15 Oct 2021 12:32:37 +0900 Subject: [PATCH] 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 --- nginx.conf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 87b36f98d..d35ca605a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -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;