Description
Choose where to terminate TLS for a web service behind a load balancer. Forwarding plaintext HTTP leaves requests and responses unencrypted.
Potential impact
Data sent over a plaintext connection can be read or changed in transit.
Remediation
For TLS pass-through, forward load_balancer_port to the backend’s TLS port. To terminate TLS at the load balancer, attach the certificate there and set instance_port to the backend’s HTTP port.
Examples
The example only changes both ports to 443. Configure the backend with a certificate for the service hostname, then make an HTTPS request to that hostname.
Before
hcl
resource "nifcloud_load_balancer" "example" {
load_balancer_name = "example"
instance_port = 80
load_balancer_port = 80
}
After
hcl
resource "nifcloud_load_balancer" "example" {
load_balancer_name = "example"
instance_port = 443
load_balancer_port = 443
}