Closed Jieiku closed 4 years ago
You will need to add something to your wp-config.php
to fix this. I've updated that comment, and added an additional FAQ (https://wordpress.org/plugins/wp-fail2ban-redux/#%0Ahow%20do%20you%20i%20use%20this%20plugin%20if%20my%20site%20is%20behind%20a%20proxy%2C%20like%20cloudflare%3F%0A). The proxy constant in WP Fail2Ban is handy, but, ultimately, it only effects the plugin. I chose not to add that, because the real fix is to fix it for your whole site. If you're behind a reverse proxy, like Cloudflare, and you only fix the issue for WP Fail2Ban Redux, then everything else on your site that uses IP addresses will be wrong.
Nginx Reverse Proxy fail2ban shows the offender as coming from the reverse proxy, definitely don't want to ban your reverse proxy and cut off ALL traffic to your site.
I have all my headers in place on the reverse proxy:
The solution that the other fail2ban package uses is working for me. I did originally try yours first.
This one allows you to define the IP of your proxy, and if defined it will use the X-Forwarded-For header: https://docs.wp-fail2ban.com/en/4.2/defines/constants/WP_FAIL2BAN_PROXIES.html#wp-fail2ban-proxies
I was able to see in your code, that you say I just need to configure wp-config.php, I am wondering which values you think would actually solve this issue and be able to use your plugin behind a reverse proxy.
In my wp-config.php I have added these lines:
section of your code: