Rate Limiting and blocking login page with too many login attempts

I am running Discourse on Ubuntu server 20.04. I have installed discourse through the docker install. Unfortunately, this default discourse setup doesn’t allow me to use fail2ban to rate limit failed login attempts to my discourse page at example.com. Therefore, I need to find a way to block too many failed login attempts to discourse using Cloudflare. Is there a way to ratelimit or block an IP address from Cloudflare based on how many failed login attempts were made to the Discourse Login page at www.example.com? Thanks in advance.

If you go to https://dash.cloudflare.com/?to=/:account/:zone/security/waf/rate-limiting-rules you’ll find rate limiting rules.

I see this, however, I’m very confused as to how to configure these rules for my use case. Do you think you could help me set the setting correctly for example.com?

I’d need, at the very least, what you have configured now with an explanation of what you want to achieve. Then I can comment on if it’s correct, or not, in my opinion.

I have nothing configured in Cloudflare and nothing in the cf waf. The only thing I have set up in Cloudflare are my root dns entry and my www cname. My site is www.randamckeownkrebsbach.com, and all I want to do is prevent users who attempt to login 2 times or more with a failed login attempt, to ban them by IP address.