如何在Cloudfront上应用CDN-路由器53 =>lightail实例 [英] How to apply CDN with cloudfront - router 53 => lightsail instance
问题描述
我是AWS的新手,我正在努力设置子域访问权限,我的资料是:
i am newbie to AWS and i am struggling set up subdomain access , my materials are :
-
53号公路:我的域名是tranthanhbao.com
Route 53 : my domain is tranthanhbao.com
Lightsail实例:18.140.2.35.我已经设置了nginx反向代理,并在Route 53中使用A-ipv4将 aws.tranthanhbao.com
指向18.140.2.35.效果不错在53号公路上将我的设置更改为18.140.2.35:
Lightsail instance : 18.140.2.35 . I already set up nginx reverse proxy and in Route 53 point aws.tranthanhbao.com
to 18.140.2.35 with A - ipv4 . It work well
MY setting in Route 53 to 18.140.2.35 :
Cloudfront :现在,我要使用以下设置将Cloudfront应用于我的域 aws.tranthanhbao.com
(http将重定向到https)
Cloudfront : now i want to apply cloudfront to my domain aws.tranthanhbao.com
(http will redirect to https) with below setting
然后,当我们访问 dsor8zoqxftko.cloudfront.net 时,它运行良好,但我检查了域ip,显示:
Then when we access dsor8zoqxftko.cloudfront.net, it works well but i check domain ip , it show :
- [http://dsor8zoqxftko.cloudfront.net/] :这是来自法国的自动重定向http到https.所以效果很好但是
- [http://aws.tranthanhbao.com/] :仍然是http,并且来自我的Lightsail实例IP
- [http://dsor8zoqxftko.cloudfront.net/] : this is from France and automatic redirect http to https. So it works well BUT
- [http://aws.tranthanhbao.com/] : still http and from my Lightsail instance IP .
所以我的问题是我该如何在Cloudfront而不是链接上应用 aws.tranthanhbao.com
:[http://dsor8zoqxftko.cloudfront.net/]
So my question is how can I apply aws.tranthanhbao.com
with cloudfront, not Link: [http://dsor8zoqxftko.cloudfront.net/]
推荐答案
您可以尝试以下步骤:
- 将
18.140.2.35
指向其他名称,例如origin.tranthanhbao.com origin.tranthanhbao.com
->18.140.2.35 - 将
origin.tranthanhbao.com
定义为CloudFront的起源,而不是aws.tranthanhbao.com
- 修改
aws.tranthanhbao.com
的路由记录,然后选择Alias记录(A记录)并选择CloudFront分配.
- Point
18.140.2.35
to some other name likeorigin.tranthanhbao.com origin.tranthanhbao.com
--> 18.140.2.35 - Define
origin.tranthanhbao.com
as an Origin of CloudFront instead ofaws.tranthanhbao.com
- Modify Route Record for
aws.tranthanhbao.com
and Choose Alias record (A record) and choose CloudFront distribution.
这篇关于如何在Cloudfront上应用CDN-路由器53 =>lightail实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!