From ed0983b633febb94fab11db3b8a86824485b08c8 Mon Sep 17 00:00:00 2001 From: ibizaman Date: Tue, 25 Oct 2022 22:00:31 -0700 Subject: [PATCH] add optional debug for haproxy siteconfig --- haproxy/siteconfig.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/haproxy/siteconfig.nix b/haproxy/siteconfig.nix index 4b7c6d1..c3c7dc5 100644 --- a/haproxy/siteconfig.nix +++ b/haproxy/siteconfig.nix @@ -12,6 +12,8 @@ , extraUseBackendConditions ? {} , extraFrontendOptions ? [] , extraBackendOptions ? [] + +, debugHeaders ? false }: with lib; @@ -73,6 +75,11 @@ in acl acl_${serviceName} hdr_beg(host) ${serviceName}.${extraAclsCondition} '' + 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} '';