Its my first post in Server Fault, so I'm sorry for any faux pas :)
Problem: When I try to access "http://dummy_server/wp-admin" that is behind an apache acting as a WAF, it gets stuck in an infinite redirect loop.
The full configuration of the HAProxy and the WAF can be found here https://www.haproxy.com/blog/scalable-waf-protection-with-haproxy-and-apache-with-modsecurity/
For what I could investigate, if I access the dummy_server while turning off the apache VH (i.e. only using the HA proxy) when I do a GET to dummy_server/wp-admin, the server responds with
HTTP/1.1 302 Found
Date: Wed, 20 Feb 2019 19:00:49 GMT
Location: https://dummy_server/wp-login.php?redirect_to=.....
Then the browser redirects to dummy_server/wp-login and waits for user credentials.
Nevertheless, if I do a GET to dummy_server with the WAF activated, the Location header changes to
Location: https://dummy_server/wp-admin
and the procceds to get stuck in a redirect loop.
If I turn of the WAF configuration (I'm using modsecurity) so that the apache only acts as a reverse proxy, but the problem persists.
Here is the VM configuration:
<VirtualHost *:90>
<IfModule mod_security2.c>
Include /etc/apache2/owasp-modsecurity-crs/crs-setup.conf
SecRuleEngine On
SecRequestBodyAccess On
SecResponseBodyAccess On
</IfModule>
ProxyPreserveHost On
ProxyRequests Off
ProxyVia Off
ProxyPass / http://192.168.57.22:81/
ProxyPassReverse / http://192.168.57.22:81/
</VirtualHost>
I've been searching in the site, but I haven'f found anything that helps me in my current predicament. Any ideas?
Thanks!