How-to

How to Set Up SSL Termination at a Load Balancer

Terminating TLS at a load balancer, rather than on every individual backend server, centralizes certificate management and reduces the CPU overhead on backend instances — the general pattern discussed in our TLS Termination basics guide, here as concrete setup steps.

1 Visitor connects over HTTPS TLS handshake happens with the load balancer, not yourapplication server directly 2 Load balancer decrypts the traffic This is the actual termination point — encryption ends here 3 Load balancer forwards the request to your server Often over plain HTTP on an internal, trusted network 4 Your application never handles TLS directly Simplifies certificate management to one place, at the cost ofan unencrypted internal hop unless separately secured
Where TLS Actually Terminates

General setup

  1. Install the certificate on the load balancer itself (or reference a managed certificate service like AWS ACM).
  2. Configure the load balancer's listener for HTTPS on port 443, attached to that certificate.
  3. Configure the backend connection — the load balancer to your actual servers — as either plain HTTP (simpler, acceptable if that hop stays within a trusted private network) or re-encrypted HTTPS (more thorough, needed if the hop crosses less trusted infrastructure).
  4. Ensure backend servers read the X-Forwarded-Proto header if they need to know the original connection was secure, since they'll otherwise see the connection as it actually arrives at them.

This is the same underlying pattern whether you're using a cloud provider's managed load balancer or a self-hosted one like HAProxy or Nginx acting in that role.

What to do if backend servers show connection errors after moving TLS termination to the load balancer

Backend connection errors after centralizing TLS at a load balancer usually mean the backend servers still expect HTTPS traffic, when they should now be configured to accept plain HTTP from the load balancer exactly, trusting the load balancer's forwarded-protocol header instead.

How to decide whether backend traffic should also be re-encrypted for defense in depth

Whether to re-encrypt the load-balancer-to-backend hop depends on your specific risk tolerance and network architecture — a genuinely private, well-segmented internal network carries lower risk than one where backend traffic could plausibly be observed by an untrusted party, making end-to-end encryption more valuable in the latter scenario.

What sticky sessions mean for TLS session resumption in a load-balanced environment

If your load balancer doesn't use sticky sessions, a client's subsequent requests might route to a different backend server each time, potentially affecting TLS session resumption efficiency depending on whether session state is shared across your backend fleet or kept per-server.

How health checks should be configured differently once TLS terminates at the load balancer

Health checks configured at the load balancer level should generally check backend server health over plain HTTP (since that's now the actual protocol used for the load-balancer-to-backend hop), rather than expecting HTTPS from backend servers that may no longer be configured to serve it directly.

Why documenting exactly where TLS terminates helps future troubleshooting significantly

A simple written note or diagram indicating exactly where TLS terminates in your infrastructure, load balancer, CDN, or origin server immediately, saves considerable troubleshooting time for anyone (including a future version of yourself) trying to diagnose a certificate or redirect issue without needing to rediscover the architecture from scratch.

What to do if requests seem to bypass the load balancer's TLS termination entirely

If your origin server unexpectedly receives plain HTTP when you configured TLS termination at the load balancer, confirming no direct path to the origin server exists (bypassing the load balancer entirely) and that DNS correctly points only to the load balancer resolves this specific, security-relevant misconfiguration.

How to handle TLS termination when using more than one load balancer for redundancy

Each load balancer in a redundant pair or pool needs identical, consistently updated certificate configuration, since traffic could route through any of them — a certificate renewed and installed on only one load balancer in a redundant set leaves the others serving a stale certificate whenever traffic happens to route through them instead.

A closing note on load balancer TLS termination as standard modern architecture

Centralizing TLS termination at a load balancer has become the standard, generally recommended architecture for any application running behind one, offering meaningful operational simplification over managing certificates independently across many individual backend servers.

Comments

Loading comments…