Lightsail CDN using Lighsail ALB Distribution with custom domain
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?
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.
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.
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.
Lightsail container as CloudFront Origin returns 404 No Such ServiceAccepted Answerasked 4 months ago
Lightsail with WAFAccepted Answerasked 2 years ago
Can't enable custom domain on Lightsailasked 11 days ago
I can't validate the Lightsail cdn SSL certificate and I don't know why?Accepted Answerasked a month ago
Lightsail S3 Bucket behind Lightsail Distributionasked 2 months ago
Lightsail CDN using Lighsail ALB Distribution with custom domainasked 21 days ago
lightsail cdn default documentasked 6 months ago
Accessing Lightsail instance running plesk web server VIA a custom domainasked 2 years ago
Using cdn with lightsail not is validating certificateasked 2 years ago
Custom domain in Lightsail container service is not workingAccepted Answerasked 6 months ago