简体   繁体   English

如何将我的外部域名指向我的AWS EC2实例中的子目录

[英]How to point my external domain name to a subdirectory in my AWS EC2 instance

I'm currently migrating my web app from a shared hosting on 1&1 to an AWS EC2. 我目前正在将Web应用程序从1&1上的共享主机迁移到AWS EC2。

I want to keep the domain name on 1&1 for now and point it to my web page which is in my new AWS EC2. 我现在暂时将域名保留在1&1上,并将其指向我的新AWS EC2中的网页。

But I'm struggling to point this domain onto a sub-directory of my EC2 instance. 但是我很难将这个域指向我的EC2实例的子目录。 I mean, for now, when I type my domain name, I run into the root of my EC2 instance, but I'd like it to immediately point to a certain sub-directory containing this certain web page. 我的意思是,现在,当我输入域名时,我会碰到EC2实例的根目录,但是我希望它立即指向包含该特定网页的某个子目录。 I'd like to be able to have several webpages in the same EC2 instance, so I would need to have different domain names for the different sub-directories but all with the same IP 我希望能够在同一个EC2实例中拥有多个网页,因此我需要为不同的子目录使用不同的域名,但所有这些都具有相同的IP

If this it is not a good way to proceed, and if it is better to have one special instance for each domain, tell me. 如果这不是进行的好方法,并且最好为每个域都使用一个特殊实例,请告诉我。 I'm new to AWS and I'm still used to the "shared hosting habits" 我是AWS的新手,但我仍然习惯于“共享的托管习惯”

This is not a DNS feature. 这不是DNS功能。 You can't point a DNS name to a specific path on a server. 您不能将DNS名称指向服务器上的特定路径。

You need to configure whatever web server software you are running on the EC2 server to serve the contents of that subdirectory when it gets a request for that particular domain name. 您需要配置在EC2服务器上运行的任何Web服务器软件,以在该子目录收到对特定域名的请求时为该子目录的内容提供服务。

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

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