summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-09-18 09:45:02 +0200
committerGitHub <noreply@github.com>2024-09-18 09:45:02 +0200
commit87611cccbcb89bcf0fb3316afd7064a7d2f66b5b (patch)
tree62b1540af039e287ffb18acb32d91c40d249b3d1 /data
parent3e1dc8d332ffdb1ea2ea6701f7b88e3332fd36c7 (diff)
parentca847d057192d97cda673bcdd38c55151cf56f7a (diff)
downloadvyos-1x-87611cccbcb89bcf0fb3316afd7064a7d2f66b5b.tar.gz
vyos-1x-87611cccbcb89bcf0fb3316afd7064a7d2f66b5b.zip
Merge pull request #4080 from vyos/mergify/bp/circinus/pr-3753
T6539: add logging options to load-balancer reverse-proxy (backport #3753)
Diffstat (limited to 'data')
-rw-r--r--data/templates/load-balancing/haproxy.cfg.j217
1 files changed, 15 insertions, 2 deletions
diff --git a/data/templates/load-balancing/haproxy.cfg.j2 b/data/templates/load-balancing/haproxy.cfg.j2
index c18a998b8..5137966c1 100644
--- a/data/templates/load-balancing/haproxy.cfg.j2
+++ b/data/templates/load-balancing/haproxy.cfg.j2
@@ -1,8 +1,6 @@
### Autogenerated by load-balancing_reverse-proxy.py ###
global
- log /dev/log local0
- log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
@@ -11,6 +9,11 @@ global
daemon
{% if global_parameters is vyos_defined %}
+{% if global_parameters.logging is vyos_defined %}
+{% for facility, facility_config in global_parameters.logging.facility.items() %}
+ log /dev/log {{ facility }} {{ facility_config.level }}
+{% endfor %}
+{% endif %}
{% if global_parameters.max_connections is vyos_defined %}
maxconn {{ global_parameters.max_connections }}
{% endif %}
@@ -67,6 +70,11 @@ frontend {{ front }}
{% if front_config.redirect_http_to_https is vyos_defined %}
http-request redirect scheme https unless { ssl_fc }
{% endif %}
+{% if front_config.logging is vyos_defined %}
+{% for facility, facility_config in front_config.logging.facility.items() %}
+ log /dev/log {{ facility }} {{ facility_config.level }}
+{% endfor %}
+{% endif %}
mode {{ front_config.mode }}
{% if front_config.tcp_request.inspect_delay is vyos_defined %}
tcp-request inspect-delay {{ front_config.tcp_request.inspect_delay }}
@@ -166,6 +174,11 @@ backend {{ back }}
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }
{% endif %}
+{% if back_config.logging is vyos_defined %}
+{% for facility, facility_config in back_config.logging.facility.items() %}
+ log /dev/log {{ facility }} {{ facility_config.level }}
+{% endfor %}
+{% endif %}
mode {{ back_config.mode }}
{% if back_config.http_response_headers is vyos_defined %}
{% for header, header_config in back_config.http_response_headers.items() %}