SSL Termination
Decrypting TLS-encrypted traffic at a load balancer or reverse proxy so backend servers receive plain HTTP. Offloads CPU-intensive crypto work and simplifies certificate management.
What is SSL Termination?
In short
SSL termination is the practice of decrypting incoming TLS (HTTPS) traffic at a load balancer or reverse proxy, so the request reaches your backend servers as plain HTTP. The proxy holds the certificate and private key and does all the encryption and decryption work, which frees backend servers from CPU-heavy crypto and means you manage certificates in one place instead of on every server.
What SSL termination actually is
When a browser connects to https://example.com, it opens a TLS connection: a handshake to agree on encryption keys, then encrypted data flowing both ways. Someone has to hold the certificate and private key for example.com and do the math to decrypt that traffic. SSL termination means that someone is your load balancer or reverse proxy, not your application server.
The proxy sits at the edge of your network. The encrypted connection ends (terminates) there. The proxy decrypts the request, then forwards it to a backend server over plain HTTP, usually inside a private network the public cannot reach. The response goes back the same way: backend speaks plain HTTP to the proxy, the proxy re-encrypts it and sends it to the browser.
The name is a bit dated. We mostly use TLS now, not the older SSL protocol, but the term SSL termination stuck. You will also hear it called TLS termination or SSL offloading, which all mean the same thing.
How it works under the hood
You install the TLS certificate and private key on the proxy (Nginx, HAProxy, an AWS ALB, Cloudflare, and so on). When a client connects, the proxy runs the TLS handshake: it presents the certificate, negotiates a cipher, and derives session keys. This handshake involves expensive public-key operations, which is the part you are trying to move off your application servers.
Once the session is established, the proxy decrypts each request into plain HTTP bytes. Because it now sees the unencrypted request, it can read the Host header, the path, and cookies, which lets it route, load balance, cache, rate limit, and add headers like X-Forwarded-For and X-Forwarded-Proto. A pure TCP passthrough cannot do any of that because it never sees inside the encryption.
From the proxy to the backend, the traffic is plain HTTP by default. That is fine if the link is a trusted private network. If you also encrypt the proxy-to-backend hop, you have TLS re-encryption (sometimes called SSL bridging): the proxy terminates the client TLS, inspects the request, then opens a fresh TLS connection to the backend. Compliance regimes like PCI DSS often require this so traffic is never in plaintext on the wire, even internally.
When to use it and the trade-offs
Use SSL termination when you have many backend servers and want one place to manage certificates and renewals, when you want the proxy to inspect and route HTTP traffic, or when your application servers are spending too much CPU on TLS. Centralizing certificates is the biggest practical win: with tools like Let's Encrypt and automated renewal, you rotate one cert at the edge instead of deploying it to fifty machines.
The main downside is that traffic between the proxy and the backend is unencrypted unless you re-encrypt it. If an attacker is already inside your network, or if you run in a shared environment, that plaintext hop is a real risk. This is why end-to-end TLS or a service mesh with mutual TLS is preferred for sensitive systems.
The other thing to watch is that backends no longer see the original client connection directly. They see the proxy. You must trust and read forwarded headers (X-Forwarded-For for the real client IP, X-Forwarded-Proto to know the request was originally HTTPS) or you will log the load balancer IP for everyone and possibly build broken redirect loops. Modern TLS with hardware AES acceleration also makes the CPU savings smaller than they were a decade ago, so for many teams the routing and certificate-management benefits matter more than the offload.
A concrete example
Say you run a web app on three EC2 instances behind an AWS Application Load Balancer. You upload your certificate to AWS Certificate Manager and attach it to the ALB's HTTPS listener on port 443. Browsers connect to the ALB over HTTPS; the ALB terminates TLS, then forwards requests to your instances over plain HTTP on port 80 inside your VPC.
Your three instances never touch a certificate, never run a TLS handshake, and never need updating when the cert renews, ACM rotates it on the ALB automatically. Each instance reads the X-Forwarded-For header to log the real visitor IP and the X-Forwarded-Proto header to know the original request was secure, so it can force HTTPS redirects correctly.
If a security review later requires encryption all the way to the instance, you flip the ALB target group to HTTPS and put a certificate on each instance too. Now the ALB still terminates the client TLS, inspects and routes the request, then re-encrypts to the backend. Same termination pattern, with the internal hop locked down.
Where it is used in production
Nginx
Extremely common as a reverse proxy that terminates TLS on port 443 and proxies plain HTTP to upstream app servers.
AWS Elastic Load Balancing
ALB and NLB terminate TLS using certificates from AWS Certificate Manager, which auto-renews them so backends stay cert-free.
Cloudflare
Terminates TLS at its edge in 300+ cities, then connects to your origin, optionally re-encrypting with Full or Full Strict mode.
HAProxy
A high-performance load balancer that terminates TLS and routes based on the decrypted HTTP request, widely used at large traffic scale.
Frequently asked questions
- What is the difference between SSL termination and SSL passthrough?
- With SSL termination the proxy decrypts traffic, sees the plain HTTP request, and can route, cache, and add headers. With SSL passthrough the proxy forwards the still-encrypted TCP bytes straight to the backend, which then does the decryption itself. Passthrough is end-to-end encrypted but blind: the proxy cannot inspect or route on the HTTP content.
- Is the traffic between the load balancer and backend encrypted?
- Not by default. After termination the proxy sends plain HTTP to the backend. That is acceptable on a trusted private network but a risk otherwise. To protect it you use re-encryption (SSL bridging), where the proxy opens a new TLS connection to the backend, or a service mesh with mutual TLS.
- Why is it still called SSL when everyone uses TLS now?
- SSL is the older protocol that TLS replaced, but the name stuck in common usage. SSL termination, TLS termination, and SSL offloading all mean the same thing today: ending the encrypted connection at a proxy. Real systems should only negotiate TLS 1.2 or 1.3, not the deprecated SSL versions.
- How does the backend know the original request was HTTPS?
- The terminating proxy adds the X-Forwarded-Proto header, set to https, and X-Forwarded-For for the original client IP. Your application reads these to log the right IP and to force HTTPS redirects. You must only trust these headers from a proxy you control, since a client could spoof them otherwise.
- Does SSL termination actually save CPU?
- It did much more a decade ago. The TLS handshake uses costly public-key operations, so moving it off app servers helped. Modern CPUs have hardware AES acceleration and TLS 1.3 has a faster handshake, so the savings are smaller now. The bigger practical wins today are centralized certificate management and the ability to route and inspect HTTP at the edge.
Learn SSL Termination hands-on
This page explains the idea. The full lesson lets you step through the ring as servers join and leave, read the implementation, and check yourself with a quiz. It is one of 760+ lessons in the System Design Masterclass, from your first API call to distributed consensus. Eleven Foundation lessons are free, no signup. Lifetime access is ₹499 in India or $7.99 worldwide, one payment, no subscription.
See also
Related glossary terms you might want to look up next.
SSL/TLS
Cryptographic protocols that encrypt data in transit between client and server. TLS is the modern successor to SSL. The 'S' in HTTPS.
Reverse Proxy
A server that sits in front of your backend servers and forwards client requests to them. Handles SSL termination, caching, and load balancing.
Load Balancer
Distributes incoming traffic across multiple servers so no single server gets overwhelmed. Like a traffic cop directing cars to different lanes.
DNS
The phonebook of the internet. Translates human-readable domain names (google.com) into IP addresses that computers understand.
Proxy
An intermediary server that sits between the client and the destination server. Forward proxies act on behalf of clients; reverse proxies act on behalf of servers.
DNS Record Types
Different types of DNS records map domains to resources: A records point to IPs, CNAME aliases one domain to another, MX routes email, TXT stores verification data.