ACL rule based on POST data possible?

Hi All,

Thank you in advance for all your help. I’m trying to create an ACL rule where the http request is denied if the POST data contains the word “nastyword”.

Something like

acl prevent_bad_words (something then reg ex search for “nastyword” etc…)
http-request deny if prevent_bad_words

Is this possible on POST data? I’ve also put

option http-buffer-request

In the defaults as I was told it would allow HAProxy access to the data.

Regards,

Victor

I think I solved it myself. Here’s the acl rule in case someone else needs it.

acl prevent_bad_words -m reg -i nastyword
http-request deny if prevent_bad_words

Prevents POST request if nastyword present

Victor