Introduce embedded HTTP server for HAProxy monitoring dashboard
- Added a Python-based HTTP server to serve `dashboard.html` at `/` or `/dashboard.html` paths. - Updated HAProxy configuration to integrate backend for the dashboard. - Enhanced handling of index paths with conditional redirects to the dashboard page. - Modified tests and updated expected outputs to reflect these changes.
This commit is contained in:
parent
67cfcf3aff
commit
7e3134155a
16 changed files with 153 additions and 70 deletions
|
|
@ -50,8 +50,14 @@ frontend dashboard
|
|||
mode http
|
||||
acl is_index path /
|
||||
acl is_index path /index.html
|
||||
http-request return status 200 content-type "text/html" file /etc/easyhaproxy/www/dashboard.html if is_index
|
||||
http-request return status 404
|
||||
acl is_dashboard path /dashboard.html
|
||||
http-request set-path /dashboard.html if is_index
|
||||
http-request return status 404 if !is_dashboard
|
||||
default_backend srv_dashboard
|
||||
|
||||
backend srv_dashboard
|
||||
mode http
|
||||
server Local 127.0.0.1:9190
|
||||
|
||||
frontend http_in_443
|
||||
bind *:443 ssl crt /etc/easyhaproxy/certs/certbot/ alpn h2,http/1.1 crt /etc/easyhaproxy/certs/haproxy/ alpn h2,http/1.1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue