Lightsail CDN using Lighsail ALB Distribution with custom domain
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?
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].
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.
Relevant questions
Lightsail container as CloudFront Origin returns 404 No Such Service
Accepted Answerasked 4 months agoLightsail with WAF
Accepted Answerasked 2 years agoCan't enable custom domain on Lightsail
asked 11 days agoI can't validate the Lightsail cdn SSL certificate and I don't know why?
Accepted Answerasked a month agoLightsail S3 Bucket behind Lightsail Distribution
asked 2 months agoLightsail CDN using Lighsail ALB Distribution with custom domain
asked 21 days agolightsail cdn default document
asked 6 months agoAccessing Lightsail instance running plesk web server VIA a custom domain
asked 2 years agoUsing cdn with lightsail not is validating certificate
asked 2 years agoCustom domain in Lightsail container service is not working
Accepted Answerasked 6 months 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.