simple redirect map

This commit is contained in:
Thomas Lynch
2023-03-04 20:18:54 +11:00
parent 4c97df8fb1
commit 5b98b5b15c
3 changed files with 5 additions and 0 deletions

View File

@ -18,6 +18,7 @@ Integrates with https://gitgud.io/fatchan/haproxy-panel-next to add/remove/edit
- Improved the appearance of the challenge page.
- Add several useful maps & acls to the haproxy config:
- Whitelist or blacklist IPs/subnets.
- Simple redirect/rewrite map for domains.
- Maintenance mode page for selected domains.
- Fix multiple security issues.
- Many bugfixes.

View File

@ -78,6 +78,9 @@ frontend http-in
acl maintenance_mode hdr(host),lower,map_str(/etc/haproxy/map/maintenance.map) -m found
http-request return lf-file /etc/haproxy/template/maintenance.html status 200 content-type "text/html; charset=utf-8" hdr "cache-control" "private, max-age=30" if maintenance_mode
# map if you want a domain to be a redirect from the edge (302 for now)
http-request redirect location https://%[hdr(host),map(/etc/haproxy/map/rewrite.map)]%[capture.req.uri] code 302 if { hdr(host),map(/etc/haproxy/map/rewrite.map) -i -m found }
# create acl for bools updated by lua
acl captcha_passed var(txn.captcha_passed) -m bool
acl pow_passed var(txn.pow_passed) -m bool

1
haproxy/map/rewrite.map Normal file
View File

@ -0,0 +1 @@
localhost cp.basedflare.com