简体   繁体   English

只允许使用域网址(AWS)访问网站

[英]Allow site access only with domain url (AWS)

I have configured an instance on AWS, and am able to access my site with both of the following URLs: http://example.com and http://ec2-12-34-56-789.eu-west-1.compute.amazonaws.com . 我已经在AWS上配置了一个实例,并且能够使用以下两个URL访问我的网站: http: //example.comhttp://ec2-12-34-56-789.eu-west-1。 compute.amazonaws.com

How can I disable access to the second URL and only keep only http://example.com ? 如何禁用对第二个URL的访问,仅保留http://example.com

When an instance is launched into a VPC, AWS provides the instance with public and private DNS hostnames if DNS hostnames are enabled for the VPC. 将实例启动到VPC中时,如果为VPC启用了DNS主机名,则AWS会为该实例提供公共和私有DNS主机名。

By default, this feature is only enabled for default VPCs and VPCs that you create using the VPC wizard in the VPC console. 默认情况下,仅对默认VPC和使用VPC控制台中的VPC向导创建的VPC启用此功能。

Your VPC setting has this feature enabled. 您的VPC设置已启用此功能。 In order to disable it, please follow the following steps: 为了禁用它,请按照以下步骤操作:

  • Login to the AWS console 登录到AWS控制台
  • Click on Services 点击服务
  • Click on VPC 点击VPC
  • Click on Your VPCs 单击您的VPC
  • Select the VPC you are using 选择您正在使用的VPC
  • Click on the Action button 点击操作按钮
  • From the pull-down menu, select Edit DNS hostnames 从下拉菜单中,选择“ 编辑DNS主机名”
  • In the Edit DNS hostnames dialog, select Yes 在“ 编辑DNS主机名”对话框中,选择“ 是”。

You may need to relaunch your instance in that VPC to remove the existing public DNS Name. 您可能需要在该VPC中重新启动实例,以删除现有的公共DNS名称。

For more information see Updating DNS Support for Your VPC 有关更多信息,请参阅为VPC更新DNS支持。

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

相关问题 在 AWS 中,我需要帮助以通过公共 ip 或公共 dns 拒绝 url 并仅允许通过域(CNAME)访问 - In AWS I need help for deny url by public ip or public dns and to allow only access by domain (CNAME) AWS API网关策略,仅允许访问特定主机URL - AWS API Gateway Policy to only allow a specific host URL to access 如何通过某些IP允许访问我的AWS Beanstalk站点上的特定URL - How can i allow access to a specific url on my AWS Beanstalk site by certain ip 如何在 AWS 中访问 ElasticSearch 域端点 URL? - How to access ElasticSearch domain endpoint URL in AWS? AWS:仅允许从 VPC 访问 Lambda - AWS: Allow access to Lambda only, from VPC 亚马逊AWS | 如何让 CORS 允许从特定域访问? - AWS | How to have CORS allow access from specific domain? AWS S3 如何只允许来自特定域的访问? - AWS S3 how to allow acces only from specific domain? 如何在没有域名的情况下访问 AWS EC2 上的站点 - How to access a site on AWS EC2 without a domain name 如何仅允许IP /范围访问AWS API Gateway资源 - How to allow only an IP/range access to AWS API Gateway resources AWS S3 – 只允许用户访问他的文件 - AWS S3 – allow user to only access his files
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM