What you will learn in this TP
- Terminate TLS and force HTTPS
- Route with ACLs
- Reload without downtime
HTTPS and ACLs #
What you will learn in this section
- Terminate TLS and force HTTPS
- Route with ACLs
- Reload without downtime
Context. A site must move to HTTPS, redirect legacy HTTP and separate API traffic from the rest, while restricting access to an admin interface. HAProxy terminates TLS and applies ACLs to route and filter.
Prerequisites: Previous lab, OpenSSL · Estimated time: 45 min
A self-signed certificate and routing rules.1. Generate a certificate
Why? HAProxy expects a PEM file with certificate and key: generating it yourself makes the lab self-contained, with no external authority.
Create the PEM file HAProxy expects.2. HTTPS frontend and redirect
Why? TLS termination offloads encryption from servers and centralises certificates; redirect and HSTS enforce secure use.
Listen on 443, redirect 80 to HTTPS and add HSTS.3. Test the routing
Why? Testing each path and the certificate checks the ACLs route correctly and the client sees what you expect.
Call/and/apiand check the certificate.4. Validate and reload without downtime
Why? Validating before reloading and using a reload signal avoids interrupting ongoing connections.
Change a rule then reload cleanly.
Difficulty level : ●●●○○ (3/5)
My progress
🧪 Launch the lab environment ↗
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
Recommended Articles
Mastering ACLs in HAProxy
A complete guide to HAProxy ACLs: learn how to configure smart routing, IP-based access control, ...
HAProxy and SSL: TLS termination, SSL passthrough and hardening
HAProxy and SSL/TLS: SSL termination, SSL passthrough in TCP mode with SNI routing, re-encryption...
Mastering ACLs in HAProxy: the complete guide
A complete guide to HAProxy ACLs: learn how to configure smart routing, IP-based access control, ...
HAProxy: a detailed guide to configuration directives
A complete exploration of HAProxy's essential directives: from bind to http-check, learn how to c...
HAProxy as a Kubernetes Ingress Controller: the production guide
Learn how to use HAProxy as an Ingress Controller in Kubernetes: direct-to-pod architecture, TLS ...
The ACME protocol: ACME server, http-01 and dns-01 challenges, TLS automation
Understand the ACME protocol: the role of the ACME server (Let's Encrypt, ZeroSSL, step-ca), the ...
Managing SSL/TLS certificates with Let's Encrypt and ACME
Learn how to automate the generation and renewal of your SSL/TLS certificates with Let's Encrypt....
Health checks and high availability
How HAProxy detects failures and handles automatic failover to healthy servers.
HAProxy in Kubernetes: the high-performance Ingress Controller
Discover in depth how HAProxy integrates with Kubernetes: direct-to-pod architecture, hot update ...