Can You Blacklist IPs from Accessing Your API? Best Practices & How-To or How to Block Unwanted Traff

14 Replies, 1554 Views

If you’re asking *can you blacklist IPs from accessing your API*, the answer is yes, but it’s not always the best fix.

Some attackers use proxies or VPNs, so blocking one IP might not stop them.

Instead, try rate limiting (like in Nginx or Cloudflare) to slow down abuse. Or use a service like AWS WAF if you’re on AWS—it’s got IP blacklisting + other protections.

Here’s a Cloudflare rule to block IPs:
1. Go to Firewall > Tools > IP Access Rules
2. Add the IP and choose "Block"

Easy peasy.

Messages In This Thread



Users browsing this thread: 1 Guest(s)