1
0
Fork 0

add optional debug for haproxy siteconfig

This commit is contained in:
ibizaman 2022-10-25 22:00:31 -07:00
parent 2f57438489
commit ed0983b633

View file

@ -12,6 +12,8 @@
, extraUseBackendConditions ? {} , extraUseBackendConditions ? {}
, extraFrontendOptions ? [] , extraFrontendOptions ? []
, extraBackendOptions ? [] , extraBackendOptions ? []
, debugHeaders ? false
}: }:
with lib; with lib;
@ -73,6 +75,11 @@ in
acl acl_${serviceName} hdr_beg(host) ${serviceName}.${extraAclsCondition} acl acl_${serviceName} hdr_beg(host) ${serviceName}.${extraAclsCondition}
'' ''
+ concatMapStrings (x: x + "\n") extraFrontendOptions + concatMapStrings (x: x + "\n") extraFrontendOptions
+ concatMapStrings (x: x + "\n") (optionals debugHeaders [
"option httplog"
"http-request capture req.hdrs len 512 if acl_${serviceName}${extraAclsOr}"
''log-format "%ci:%cp [%tr] %ft [[%hr]] %hs %{+Q}r"''
])
+ '' + ''
use_backend ${serviceName} if acl_${serviceName}${extraAclsOr} use_backend ${serviceName} if acl_${serviceName}${extraAclsOr}
''; '';