Skip to content

Commit 4dda1ed

Browse files
committed
Enable health checking for HAProxy backend servers
- Updated HAProxy configuration templates to include `check` for `srv_stats` and `srv_dashboard` backends. - Adjusted expected test case outputs to account for the added health check settings.
1 parent 7e31341 commit 4dda1ed

9 files changed

Lines changed: 15 additions & 15 deletions

File tree

deploy/docker/assets/etc/easyhaproxy/www/dashboard.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/dashboard.png

124 KB
Loading

src/templates/haproxy.cfg.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ frontend stats
9090

9191
backend srv_stats
9292
mode http
93-
server Local 127.0.0.1:{{ data_stats["port"] | default(1936) }}
93+
server Local 127.0.0.1:{{ data_stats["port"] | default(1936) }} check
9494

9595
frontend dashboard
9696
bind *:{{ (data_stats["port"] | default(1936) | int) + 10000 }}
@@ -104,7 +104,7 @@ frontend dashboard
104104

105105
backend srv_dashboard
106106
mode http
107-
server Local 127.0.0.1:{{ dashboard_server_port }}
107+
server Local 127.0.0.1:{{ dashboard_server_port }} check
108108
{% endif %}
109109
{% for o in data["easymapping"] -%}
110110
{% set mode = o["mode"] or "http" %}

tests/expected/docker.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ frontend stats
3535

3636
backend srv_stats
3737
mode http
38-
server Local 127.0.0.1:1936
38+
server Local 127.0.0.1:1936 check
3939

4040
frontend dashboard
4141
bind *:11936
@@ -49,7 +49,7 @@ frontend dashboard
4949

5050
backend srv_dashboard
5151
mode http
52-
server Local 127.0.0.1:9190
52+
server Local 127.0.0.1:9190 check
5353

5454
frontend http_in_443
5555
bind *:443 ssl crt /etc/easyhaproxy/certs/certbot/ alpn h2,http/1.1 crt /etc/easyhaproxy/certs/haproxy/ alpn h2,http/1.1

tests/expected/services-letsencrypt.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ frontend stats
4343

4444
backend srv_stats
4545
mode http
46-
server Local 127.0.0.1:1936
46+
server Local 127.0.0.1:1936 check
4747

4848
frontend dashboard
4949
bind *:11936
@@ -57,7 +57,7 @@ frontend dashboard
5757

5858
backend srv_dashboard
5959
mode http
60-
server Local 127.0.0.1:9190
60+
server Local 127.0.0.1:9190 check
6161

6262
frontend http_in_80
6363
bind *:80

tests/expected/services-multiple-hosts.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ frontend stats
4343

4444
backend srv_stats
4545
mode http
46-
server Local 127.0.0.1:1937
46+
server Local 127.0.0.1:1937 check
4747

4848
frontend dashboard
4949
bind *:11937
@@ -57,7 +57,7 @@ frontend dashboard
5757

5858
backend srv_dashboard
5959
mode http
60-
server Local 127.0.0.1:9190
60+
server Local 127.0.0.1:9190 check
6161

6262
frontend http_in_19901
6363
bind *:19901

tests/expected/ssl-loose.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ frontend stats
3333

3434
backend srv_stats
3535
mode http
36-
server Local 127.0.0.1:1936
36+
server Local 127.0.0.1:1936 check
3737

3838
frontend dashboard
3939
bind *:11936
@@ -47,7 +47,7 @@ frontend dashboard
4747

4848
backend srv_dashboard
4949
mode http
50-
server Local 127.0.0.1:9190
50+
server Local 127.0.0.1:9190 check
5151

5252
backend certbot_backend
5353
mode http

tests/expected/static-cors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ frontend stats
5050

5151
backend srv_stats
5252
mode http
53-
server Local 127.0.0.1:1936
53+
server Local 127.0.0.1:1936 check
5454

5555
frontend dashboard
5656
bind *:11936
@@ -64,7 +64,7 @@ frontend dashboard
6464

6565
backend srv_dashboard
6666
mode http
67-
server Local 127.0.0.1:9190
67+
server Local 127.0.0.1:9190 check
6868

6969
frontend http_in_80
7070
bind *:80

tests/expected/static.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ frontend stats
4343

4444
backend srv_stats
4545
mode http
46-
server Local 127.0.0.1:1936
46+
server Local 127.0.0.1:1936 check
4747

4848
frontend dashboard
4949
bind *:11936
@@ -57,7 +57,7 @@ frontend dashboard
5757

5858
backend srv_dashboard
5959
mode http
60-
server Local 127.0.0.1:9190
60+
server Local 127.0.0.1:9190 check
6161

6262
frontend http_in_443
6363
bind *:443 ssl crt /etc/easyhaproxy/certs/certbot/ alpn h2,http/1.1 crt /etc/easyhaproxy/certs/haproxy/ alpn h2,http/1.1

0 commit comments

Comments
 (0)