I am aware that it is straightforward to use AWS CloudFront
with an AWS Application Load Balancer (Layer 7) origin (using a certificate in each for E2E encryption). However, is it possible to use AWS CloudFront
(with certificate) and an AWS Network Load Balancer (Layer 4) origin to distribute HTTP over non-standard ports (in this case, TCP 4000 and TCP 3000)?
I have implemented CloudFront with a Network Load Balancer origin. When queried, a 504 is generated by CloudFront (TCP 443 > TCP 3000), which suggests a timeout.
I have confirmed that there are no issues with the security group and network load balancer configuration using nc
(for example, nc -zv lb-rswvin-XXXXX.elb.XXXXX.amazonaws.com 4000
returns Connection to lb-rswvin-XXXXX.elb.XXXXX.amazonaws.com (X.X.X.X) 4000 port [tcp/] succeeded!*Connection to lb-rswvin-XXXXX.elb.XXXXX.amazonaws.com (X.X.X.X) 4000 port [tcp/*] succeeded!
)
I am open to alternative solutions/suggestions (e.g. a dedicated EC2 instance acting as a reverse proxy) but prefer to use a native AWS service/feature.
All infrastructure was deployed using IaC (Terraform).