I'm using pfsense with HAProxy package. Using simple rule i would like to only allow access to a website if the IP is in the allow list.
For some reason im always getting a 404 response and cannot access the webpage. My public IP was obtained from here for testing: https://whatismyipaddress.com/
Any ideas what could be wrong with my access rules?
Here's the generated config:
frontend Shared-merged
bind 111.111.111.111:443 name 111.111.111.111:443 ssl crt-list /var/etc/haproxy/Shared.crt_list
mode http
log global
option http-keep-alive
option forwardfor
acl https ssl_fc
http-request set-header X-Forwarded-Proto http if !https
http-request set-header X-Forwarded-Proto https if https
timeout client 30000
acl aclcrt_Shared var(txn.txnhost) -m reg -i ^([^\.]*)\.example\.com(:([0-9]){1,5})?$
acl aclcrt_Shared var(txn.txnhost) -m reg -i ^example\.com(:([0-9]){1,5})?$
acl ACL1 var(txn.txnhost) -m str -i site1.example.com
acl ACL2 var(txn.txnhost) -m str -i site2.example.com
acl AllowedIps src 111.111.111.111
acl MatchDomain var(txn.txnhost) -m str -i site3.example.com
http-request set-var(txn.txnhost) hdr(host)
http-request deny deny_status 404 if !AllowedIps MatchDomain
use_backend site1_ipvANY if ACL1
use_backend site2_ipvANY if ACL2
use_backend site3_ipvANY if MatchDomain AllowedIps