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 Antworten
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
beantwortet vor 2 Jahren
  • 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.

beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen