Hi all, I’m pretty new to HAproxy, but it’s fantastic so far. I’m hosting multiple intranet sites with it to test some stuff. For ease of description I’m going to limit this to one page here. Here is my issue:
frontend public
bind 192.168.2.2:80 v4v6
option forwardfor except 127.0.0.1
default_backend pihole
acl isaak hdr(host) -i isaak.com
acl isaak1 hdr(host) -i www.isaak.com
use_backend isaak1 if isaak or isaak1
backend pihole
reqrep ^([^\ :]*)\ (.*) \1\ /admin\2
server pihole 127.0.0.1:8081
backend isaak1
reqrep ^([^\ :]*)\ (.*) \1\ /isaak\2
server isaak 192.168.2.2:8082
Obviously this config is not only super redundant but also there is a problem. This server, as you can see, also hosts my pi-hole. I’m using local DNS records to forward isaak.com to lighttpd running on port 8082.
My questions:
- Whenever I click a link (let’s say files/) on isaak.com the regrep forwards this to isaak.com/isaak/files, how do I fix the regrep? I’ve been googling for hours but I’m not sure what to search for.
- Can I somehow use wildcards in the acls to make this less redundant?
Thanks in advance!
1 post - 1 participant