HAproxy deny access to specific user-agent

Jbn1233
Feb 26, 2021

--

Example: you don’t like a bot to poke around your webserver.

frontend www-https
http-request deny if { req.hdr(user-agent) -m sub facebookexternalhit }

Done.

PS. this is single line configuration.

--

--

Jbn1233
Jbn1233

Written by Jbn1233

Very short and simple notes for CKA/SRE and may not works on your environment | jbn1233@gmail.com | Bangkok, Thailand |

No responses yet