mirror of
https://gitgud.io/fatchan/haproxy-protection.git
synced 2025-05-09 02:05:37 +00:00
Add ACL so alt-svc header is only sent when geo continent not matching server env
This commit is contained in:
@ -142,7 +142,10 @@ frontend http-in
|
||||
acl can_cache var(txn.path) -i -m end .png .jpg .jpeg .jpe .ico .webmanifest .xml .apng .bmp .webp .pjpeg .jfif .gif .mp4 .webm .mov .mkv .svg .m4a .aac .flac .mp3 .ogg .wav .opus .txt .pdf .sid
|
||||
|
||||
# optional alt-svc header (done after cache so not set in cached responses
|
||||
# http-response set-header Alt-Svc %[var(txn.xcn),map(/etc/haproxy/map/alt-svc.map)]
|
||||
acl match_server_continent var(txn.xcn) -m str "${HAPROXY_CONTINENT}"
|
||||
http-response set-header X-Server-CN "${HAPROXY_CONTINENT}"
|
||||
http-response set-header X-User-CN %[var(txn.xcn)]
|
||||
http-response set-header Alt-Svc %[var(txn.xcn),map(/etc/haproxy/map/alt-svc.map)] if !match_server_continent
|
||||
|
||||
# header checks for no caching
|
||||
# acl auth_cookie_set res.hdr(Set-Cookie),lower -m found
|
||||
|
Reference in New Issue
Block a user