Using mod_evasive on a specific directory
Asked Answered
L

1

7

I'm trying to limit requests to an API on an internal site

I've managed to implement mod_evasive to successfully block requests after a specific amount in a specific time.

But this is causing problems for users of the webUI

I've tried limiting the scope of mod_evasive to the api directory but Apache2 is complaining about an invalid config file

<Location /api >                                                                        
  <IfModule mod_evasive20.c>
    DOSPageCount 2
    DOSSiteCount 50
    ..
  </IfModule>
</Location>

Any ideas SO?

Layby answered 25/8, 2011 at 12:36 Comment(0)
P
-1

You could move your api service to a subdomain (redirect)

Another idea is use nginx:80 and apache:8080 like a reverse proxy and implement a better config for stop the ddos.

Maybe the ddos you suffer always used the same pattern that can be blocked with (iptables and mbstring) 'look at the accesslog'.

iptables -A INPUT -m string --string 'PATTERN-STRING' --algo bm -j DROP

Good Luck

Preindicate answered 8/4, 2013 at 5:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.