繁体   English   中英

将来自不同主机的多个IP地址指向具有不同端口的同一域名

[英]Pointing multiple IP address from different hosts to a same domain name with different port

我尝试使用弹性IP地址创建Amazon EC2实例。 在这里,我部署了Bitnami的MEAN应用程序。

另一方面,我们有一个CPanel(不是在亚马逊上部署的,我认为它是Apache,不确定,我不是部署它的人)

Cpanel已经指向www.example.com,因此我们可以通过www.example.com:2082访问cpanel,但默认的www.example.com:80为空白/空。 我们将Cpanel用于我们的邮件服务器。

我需要做的是将Amazon EC2公共IP和DNS指向www.example.com:80。 我可以在“ Cpanel DNS区域编辑器”中进行设置吗? 还是需要设置Amazon Route 53? 我需要什么?

如果在Amazon的Cpanel DNS区域编辑器中创建新的A记录,则无法访问Cpanel www.example.com:2082。 我现在真的很困惑。 请帮忙。

为此,您需要引入一个代理服务器。由于在DNS中,您无法设置端口,因为每种类型的请求都已经定义了端口。 您可以添加nginx或haproxy或任何其他反向代理服务器,它们将接受所有请求并将请求传递给适当端口上的适当主机。

我知道已经有点晚了,但是以防万一您仍然需要它或有人遇到这个问题:

无需代理。

You point the A record for example.com to EC2 IP.
CNAME for WWW to example.com
Then you should have an A record for mail.example.com for your cPanel IP
Your MX records should point to mail.example.com and not to example.com.
And you can access cPanel at mail.example.com:2082 or whatever the server's IP or main hostname is. The main hostname has the advantage that you can use port 2083 for SSL cPanel connections
Just make sure the e-mail clients use mail.example.com and not example.com as the connecting mail server.

暂无
暂无

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

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