Skip to content

Commit

Permalink
custom httphck if basic_auth is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ntk148v committed Nov 13, 2024
1 parent 42ef0c8 commit 01ddd71
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ansible/roles/haproxy/templates/haproxy.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ defaults
listen prometheus
bind {{ ansitheus_vip_address }}:{{ prometheus_port }}
option httpchk GET /-/ready
{% if prometheus_web_config.basic_auth_users | length > 0 %}
http-check expect status 401
{% else %}
http-check expect status 200
{% endif %}
http-request del-header X-Forwarded-Proto
http-request set-header X-Forwarded-Proto https if { ssl_fc }
{% for host in groups['prometheus'] %}
Expand Down

0 comments on commit 01ddd71

Please sign in to comment.