rob_hicks
rob_hicks

Reputation: 1734

Blocking HTTP methods using HAPROXY

How to construct HAPROXY configuration file to block requests for specific HTTP methods?

We're starting to see a number of attacks using methods that we do not support in our apps. We would prefer to reject the traffic at our load balancers rather than have our apps get bogged down with them.

Upvotes: 3

Views: 8816

Answers (2)

Geoff_Clapp
Geoff_Clapp

Reputation: 301

acl kill_it method TRACE
http-request deny if kill_it

Place this in the frontend section to explicitly deny the TRACE method.

Upvotes: 1

Louis Kriek
Louis Kriek

Reputation: 728

Try putting this in:

acl valid_method method GET HEAD
http-request deny if ! valid_method

this will deny any method that is NOT GET or HEAD. Change it to suit your needs

Upvotes: 11

Related Questions