0

I have aws machine on which i'm running my spring boot application. The public url of application is say "abc.com" i'm using apache2 to redirect request coming to abc.com to localhost:8080.

Some web servers are spamming my services and i want to block them using IP blacklisting. But i can't figure-out how.

Doesn't seem like i can use .htaccess (please tell me if i can and how)

So far i have tried to block ip through my apache2.conf with below code

<LocationMatch "/.*">
Order Allow,Deny
Allow from all
SetEnvif X-Forwarded-For "148\.72\.232\.128" DenyAccess\
#repeat the SetEnvlf X-Forwarded-For ... for each IP you want to block
Deny from env=DenyAccess
</LocationMatch>

but its not working. Any idea how can I do it?

Kumar Gaurav
  • 123
  • 1
  • 3

1 Answers1

1

Create deny network ACLs for your VPC, to prevent the requests from ever reaching your instance. Screenshots from a few years ago, it will look different now.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34