mirror of
https://gitgud.io/fatchan/haproxy-protection.git
synced 2025-05-09 02:05:37 +00:00
Read from ddos_config table to determine if nojs script should be shown (allowing to be disabled per domain or path
This commit is contained in:
@ -56,9 +56,12 @@ frontend http-in
|
||||
# http-response set-header alt-svc "h3=\":443\";ma=900;"
|
||||
|
||||
# Or instead, for Tor, to use circuit IDs as "IP":
|
||||
#bind 127.0.0.1:80 accept-proxy
|
||||
# bind 127.0.0.1:80 accept-proxy
|
||||
option forwardfor
|
||||
|
||||
# custom log format
|
||||
log-format "{\"cc\":%{+Q}[capture.req.hdr(1)],\"cip\":\"%ci\",\"cp\":\"%cp\",\"hh\":%{+Q}[capture.req.hdr(0)],\"backend\":\"%b\",\"server\":\"%s\",\"timers\":\"%TR/%Tw/%Tc/%Tr/%Ta\",\"status\":\"%ST\",\"bytes\":\"%B\",\"bs\":\"%U\",\"conns\":\"%ac/%fc/%bc/%sc/%rc\",\"q\":\"%sq/%bq\",\"req\":%{+Q,+E}r,\"GeoIP_Source\":\"GeoIP_Source=%ci\"}"
|
||||
|
||||
# optional geoip handling (maps required) and alt-svc header addition
|
||||
http-request set-var(req.xcc) src,map_ip(/etc/haproxy/map/geoip.map)
|
||||
http-request set-var(req.asn) src,map_ip(/etc/haproxy/map/iptoasn.map)
|
||||
@ -139,8 +142,8 @@ frontend http-in
|
||||
|
||||
# acl for domains in maintenance mode to return maintenance page (after challenge page htp-request return rules, for the footerlogo)
|
||||
acl maintenance_mode hdr(host),lower,map_str(/etc/haproxy/map/maintenance.map) -m found
|
||||
#http-request lua.set-lang-json
|
||||
#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 lua.set-lang-json
|
||||
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
|
||||
|
||||
# optional alt-svc header (done after cache so not set in cached responses
|
||||
acl match_server_continent var(txn.xcn) -m str "${HAPROXY_CONTINENT}"
|
||||
|
Reference in New Issue
Block a user