Lightsail CDN using Lighsail ALB Distribution with custom domain

0

Hi,

I have the following infrastructure: LightSail CDN --- (distribuition) > Lightsail ALB --> Lightsail Servers

Everything works as expected except my custom domain from CDN which changes to Load Balancer DNS name once someone hits my custom DNS. For example: My domain is pointing to CDN DNS Name using approved certificate and enabled custom domain. So the network behaves like that: Mydomain (mysample.com) -> Lighsail CDN ( cdn-sample123.cloudfront.net) -> Lighsail Load Balancer (lb-sample.elb.amazonaws.com) -> Lightsail Instances.

The problem is when I hit "mysample.com". My web site is indeed loaded but the address changes to lb-sample.elb.amazonaws.com. The consequence as you can expect is the browser complaning about certificate: the certificate is issued to mysample.com and the URL address is lb-sample.elb.amazonaws.com.

How can I prevent CDN change the address to the load balancer and keep my custom DNS instead?

2 Answers
0

Hi Jasinski,

I understand you access your website the address changes to “lb-sample.elb.amazon.aws.com” and does not stay as the custom address `mysample.com. You can prevent the change by creating an SSL/TLS certificate for your distribution, follow the documentation with the guided steps[1].

[1] https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-create-a-distribution-certificate

Lwazi
answered 2 years ago
  • Hi Lwazi, thanks by the answer. I already have ths SSL/TLS certificate ate my CDN. I think the issue is that my ALB is also SSL/TLS configured and probably this is changing the URL from my CDN custom domain.

0

The issue was that my ALB was SSL/TLS configured also. So once CDN was redirecting to ALB, the ALB also changed to enforce SSL. To solve this I've created a new load balancer withou SSL/TLS and redirected my CDN to this LB.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions