简体   繁体   English

在 Route 53 和 S3 中使用国际化域名

[英]Using internationalized domain name with Route 53 and S3

I would like to expose static web page hosted on Amazon S3 to the world under following address:我想通过以下地址向全世界公开托管在 Amazon S3 上的 static web 页面:

zolty.aaa

What's more, I would like to redirect users from following addresses:更重要的是,我想从以下地址重定向用户:

zol-ty.aaa
żółty.aaa
żólty.aaa
... and all combinations of z-ż, o-ó, etc.. 

to the main address - zolty.aaa.到主要地址 - zolty.aaa。 Of course all domains were bought.当然,所有域名都被购买了。

When it comes to first domain name it's quite easy.当涉及到第一个域名时,这很容易。

  1. Set up zolty.aaa in Route53 as ALIAS to zolty.aaa S3 bucket在 Route53 中将 zolty.aaa 设置为 zolty.aaa S3 存储桶的别名
  2. Set up zol-ty.aaa in Route53 as ALIAS to zol-ty.aaa S3 bucket在 Route53 中将 zol-ty.aaa 设置为 zol-ty.aaa S3 存储桶的别名
  3. Redirect all request (in S3 bucket settings) from zol-ty.aaa to zolty.aaa将所有请求(在 S3 存储桶设置中)从 zol-ty.aaa 重定向到 zolty.aaa

Unfortunately it's not that simple if domain contains non ASCII characters.不幸的是,如果域包含非 ASCII 字符,事情就没那么简单了。

Based on AWS documentation punycode should be used for internationalized domain names.基于AWS 文档punycode 应该用于国际化域名。

So now my domain looks as follows:所以现在我的域如下所示:

xn--ty-4ja03asj.aaa

I am able to create hosted zone in Route 53 with such name.我能够使用这样的名称在 Route 53 中创建托管区域。 Now I want to create S3 bucket and add ALIAS to this bucket in DNS (Route53).现在我想创建 S3 存储桶并将 ALIAS 添加到 DNS (Route53) 中的这个存储桶。 Based on Amazon documentation, the name of S3 bucket should be the same as domain name.根据 Amazon 文档,S3 存储桶的名称应与域名相同。 So I'm creating bucket xn--ty-4ja03asj.aaa.所以我正在创建存储桶 xn--ty-4ja03asj.aaa。 But it's not visible in Route53 as a possible target of ALIAS.但它在 Route53 中不可见作为 ALIAS 的可能目标。

How can I achieve described behaviour?我怎样才能实现所描述的行为?

I will be grateful for help.我将不胜感激。

Check here What you need to do is: 在这里检查您需要做的是:

  1. Convert your domain to punycode : https://cryptii.com/pipes/punycode将您的域转换为punycodehttps : //cryptii.com/pipes/punycode

  2. Create a hosted zone and set that punycode as a domain name;创建一个托管区域并将该punycode设置为域名;

  3. Add the nameservers from your hosted zone to the domain control panel ;将您托管区域中的名称服务器添加到域控制面板;

S3 buckets must be created using punycode with the initial xn-- removed. S3 存储桶必须使用punycode创建,并删除了初始的xn--

The punycode name for the domain żółty.aaa would be xn--ty-4ja03asj.aaa .żółty.aaa的 punycode 名称将是xn--ty-4ja03asj.aaa The S3 bucket created must therefore be ty-4ja03asj.aaa .因此,创建的 S3 存储桶必须是ty-4ja03asj.aaa

As an aside, if using Cloudfront you then set the origin as ty-4ja03asj.aaa.s3-website-<region>.amazonaws.com or if simply pointing from Route 53 use s3-website-<region>.amazonaws.com after having selected "Alias to S3 website endpoint".顺便说一句,如果使用 Cloudfront,则将原点设置为ty-4ja03asj.aaa.s3-website-<region>.amazonaws.com或者如果只是从 Route 53 指向使用s3-website-<region>.amazonaws.com之后选择了“S3 网站端点的别名”。

Unfortunately S3 bucket names must not start with the prefix xn--不幸的是,S3 存储桶名称不能以前缀 xn-- 开头

The need for having the same domain and bucket name only applies if you set it up through Route 53 directly.仅当您直接通过 Route 53 进行设置时,才需要具有相同的域名和存储桶名称。 If you set it up with CloudFront the bucket and domain don't have to be identical.如果您使用 CloudFront 进行设置,则存储桶和域不必相同。

I used one of the tutorials out there in order to associate my IDN with my s3 static website.我使用其中一个教程将我的 IDN 与我的 s3 static 网站相关联。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS Route 53 域名仍未指向 IP - AWS Route 53 domain name still not pointing to IP S3 + Cloudfront + Route53 奇怪的缓存问题 - S3 + Cloudfront + Route53 weird caching issue Route 53 域仅在以 http(s):// 为前缀时才有效 - Route 53 domain only works when prefixed with http(s):// “找不到匹配的 Route53Zone”:Terraform 的 Route53 数据源无法识别托管区域名称 - "no matching Route53Zone found": Terraform's Route53 data source is not recognizing the hosted zone name cdk api 网关 route53 lambda 自定义域名不工作 - cdk api gateway route53 lambda custom domain name not working Route 53 中的 CNAME 重定向到域的子文件夹 - CNAME in Route 53 redirect to subfolder of domain 具有 53 号路由的 google 域的 aws 证书管理器 - aws certificate manager for google domain with route 53 Apex 域重定向到 www Route 53 - Apex domain redirect to www Route 53 是否可以使用 apex 域将 Route 53 托管区域连接到 Lightsail 容器服务? - Is it possible to connect a Route 53 hosted zone to Lightsail Container Service using the apex domain? ROUTE 53 域重定向到实例的 ip 而不是保留域 url - ROUTE 53 domain redirect to ip of instance inestead to keep the domain url
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM