简体   繁体   English

如何将子域指向AWS EC2

[英]How to point subdomain to aws ec2

I have created sub domain of my site. 我已经创建了网站的子域。 Its on bigrocks. 它在大石头上。 Now I have ec2 instance with elastic ip and I am running a site from there. 现在,我有了带有弹性IP的ec2实例,并且正在从那里运行一个站点。 I can access that site by IP/SITE_NAME from local browsers of current machines also. 我也可以通过IP / SITE_NAME从当前计算机的本地浏览器访问该站点。 SO it runs on ec2 as well as on current machine. 因此,它可以在ec2以及当前计算机上运行。 Now I want to link that site to my su bdomain. 现在,我想将该站点链接到我的su bdomain。 So how can I do that? 那我该怎么办呢? I don't want to redirect sub domain. 我不想重定向子域。 Browser should display the sub domain name it self and contents from aws ec2 instance Please help 浏览器应显示其自身的子域名以及来自AWS EC2实例的内容请帮助

使用弹性IP作为值为您的子域创建A记录。

Login to your cpanel. 登录到您的cpanel。 go to simple DNS Zone Editor 转到简单的DNS区域编辑器

Enter your sub domain name and IP address of aws ec2 instance in A records and click on Add. 在A记录中输入aws ec2实例的子域名和IP地址,然后单击Add。

Now you can open your subdomain/site_name and you wil see the page which is hosted on aws ec2 instance. 现在,您可以打开您的subdomain / site_name,您将看到在AWS ec2实例上托管的页面。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM