Best Recommendation for level where to terminate the TLS. #13687
|
Hello All, |
Replies: 4 comments 5 replies
|
Both options are valid — here's a breakdown to help you decide: Option A: Terminate TLS at the Load Balancer
Option B: Terminate TLS at the APISIX Data Plane (recommended for your use case) Since you explicitly need data to stay encrypted end-to-end and you're already running in decoupled mode with etcd, this is the stronger fit:
Hybrid option (also common): Use a TCP/L4 load balancer with TLS passthrough to distribute traffic to your APISIX data planes, which then perform the actual TLS termination [6]. This gives you both HA load distribution and end-to-end encryption. One caveat: you may need Proxy Protocol v2 on the LB to preserve client IPs, and there's a known quirk where My recommendation: Given your requirement that data must stay encrypted and you already have etcd in place, terminate TLS at the APISIX data plane level with a TCP passthrough load balancer in front. This ensures encryption all the way to the gateway while still leveraging your LB for traffic distribution and health checks. Store certs via the Admin API (control plane) and etcd will handle synchronization to both data planes automatically. To reply, just mention @dosu. Docs are dead. Just use Dosu. |
|
The deciding question is what you mean by “encrypted”. If TLS terminates at the load balancer, then client-to-LB traffic is encrypted, but LB-to-APISIX is plaintext unless you add a second TLS hop. That is fine for many internal networks, but it is not end-to-end encryption to the gateway. If you need traffic to remain encrypted all the way to APISIX data planes, use this layout: client --TLS--> L4/TCP load balancer --TLS passthrough--> APISIX data planeThen terminate TLS on APISIX. Manage certificates through the APISIX SSL resource on the control plane; the data planes will receive the SSL config from etcd/config sync. This gives you:
The trade-off is that a pure TCP/L4 load balancer cannot inspect HTTP paths/headers. If you need WAF/routing/HTTP logic at the LB, then use L7 TLS termination at the LB and re-encrypt to APISIX: client --TLS--> L7 load balancer --TLS again--> APISIX data planeIn that case, configure APISIX to listen with TLS too, and make sure So my recommendation would be:
Also protect etcd/control-plane access carefully, because if SSL private keys are stored in APISIX SSL resources, etcd/config access becomes part of your certificate security boundary. |
|
@pick7 |
The deciding question is what you mean by “encrypted”.
If TLS terminates at the load balancer, then client-to-LB traffic is encrypted, but LB-to-APISIX is plaintext unless you add a second TLS hop. That is fine for many internal networks, but it is not end-to-end encryption to the gateway.
If you need traffic to remain encrypted all the way to APISIX data planes, use this layout:
Then terminate TLS on APISIX. Manage certificates through the APISIX SSL resource on the control plane; the data planes will receive the SSL config from etcd/config sync. This gives you: