无法使用 Route 53 将子域重定向到 Elastic Beanstalk 环境

Failing to Redirect Subdomain with Route 53 to Elastic Beanstalk Environment

目的:设置重定向到弹性 beantalk 实例的子域

我最近从 GoDaddy 购买了一个域 (tscthub.co.uk),通过 GANDI 将其转移到 'AWS Route 53',并等待 SSL 通过 'AWS Certificate Manager' 获得批准。

另外我创建了一个 'AWS Elastic Beanstalk' 应用程序 运行 元数据库使用 this guide. This is up and running and I can successfully access it. Whilst the metabase env url works nicely, the public IPv4 address and public IPv4 DNS 当我关注它们时不要加载任何东西。

接下来,我尝试按照 "Routing traffic to an AWS Elastic Beanstalk environment" guide on the AWS docs. In 'AWS Route 53' I first created a new public hosted zone for 'tscthub.co.uk'. I edited the named servers in the registered domain to match that of the hosted zone. Then because my 'AWS Elastic Beanstalk' environment url had the region within it I thought I could use an alias as per the guide, however, upon trying I got the error "an alias to another record in the same hosted zone are global and available only in US East (N. Virginia)" and unfortunately I'm using 'eu-west-2' (this comment 更详细地讨论这个问题)。

因此,我只是使用了创建新 CNAME 记录的后备方法,其中记录名称为 'test.tscthub.co.uk',值为 'http://metabase-env.eba-i2ysq7n4.eu-west-2.elasticbeanstalk.com/'。在等待几个小时让所有内容都重新路由后,我尝试访问 'http://test.tscthub.co.uk/' 但我只是收到“无法访问此站点”。

事实证明 "Routing traffic to an AWS Elastic Beanstalk environment" 指南没有提到的是您可以创建一个“A”记录并将其设置为弹性 beanstalk 环境...