mirror of
https://gitgud.io/fatchan/haproxy-protection.git
synced 2025-05-09 02:05:37 +00:00
simple redirect map
This commit is contained in:
@@ -18,6 +18,7 @@ Integrates with https://gitgud.io/fatchan/haproxy-panel-next to add/remove/edit
|
|||||||
- Improved the appearance of the challenge page.
|
- Improved the appearance of the challenge page.
|
||||||
- Add several useful maps & acls to the haproxy config:
|
- Add several useful maps & acls to the haproxy config:
|
||||||
- Whitelist or blacklist IPs/subnets.
|
- Whitelist or blacklist IPs/subnets.
|
||||||
|
- Simple redirect/rewrite map for domains.
|
||||||
- Maintenance mode page for selected domains.
|
- Maintenance mode page for selected domains.
|
||||||
- Fix multiple security issues.
|
- Fix multiple security issues.
|
||||||
- Many bugfixes.
|
- Many bugfixes.
|
||||||
|
@@ -78,6 +78,9 @@ frontend http-in
|
|||||||
acl maintenance_mode hdr(host),lower,map_str(/etc/haproxy/map/maintenance.map) -m found
|
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
|
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
|
# create acl for bools updated by lua
|
||||||
acl captcha_passed var(txn.captcha_passed) -m bool
|
acl captcha_passed var(txn.captcha_passed) -m bool
|
||||||
acl pow_passed var(txn.pow_passed) -m bool
|
acl pow_passed var(txn.pow_passed) -m bool
|
||||||
|
1
haproxy/map/rewrite.map
Normal file
1
haproxy/map/rewrite.map
Normal file
@@ -0,0 +1 @@
|
|||||||
|
localhost cp.basedflare.com
|
Reference in New Issue
Block a user