Customize error code 503 for locked out users
-
Hi there,
I currently have a few WordPress sites hosted on AWS Beanstalk environments and use Wordfence as a WAF in all of these sites. We have enabled the option to block IP addresses that try to log in more than 10 times with wrong credentials and this throws out 503 error codes to the visitors. I think this is the expected behavior, but the problem is that every time our webserver gets a 500 error, our Beanstalk treats this as a faulty web server and shows a warning in AWS console. This is just a warning but it’s a bit annoying to have this warning from time to time.
Wordfence live traffic with 503 error codes:
https://ibb.co/PcFY97r
AWS Beanstalk complaining about these 50x errors:
https://ibb.co/bKPJZW4I was looking at the Wordfence plugin code and I think I found how to customize this error code to something more useful in our case, like 403 or 404 errors, in these files:
vendor/wordfence/wf-waf/src/lib/waf.php
vendor/wordfence/wf-waf/src/lib/utils.php
But I don’t know if there is another way to customize this code and make it persistent if we update Wordfence to newer versions, or if this is a feature I should request.Thanks!
- You must be logged in to reply to this topic.