将域名映射到多个 AWS Elastic Beanstalk 实例

Map domain name to multiple AWS Elastic Beanstalk instances

我工作的公司有多个弹性 beantalk 应用程序。我们已经设置了一个域(例如 http://applications.ourcompany.com ) that currently directs to one of these instances. This works fine, the user enters http://applications.ourcompany.com,它们最终出现在这个 ELB 实例中。但是我们真正想要的是像下面这样的东西:

http://applications.ourcompany.com/appone - maps to http://appone.elasticbeanstalk.com

http://applications.ourcompany.com/apptwo - maps to http://apptwo.elasticbeanstalk.com

等等。我一直在阅读 IAM 中的 AWS Documentation but it isn't immediately obvious if this is possible, or how to go about it. This is further complicated by our need to use HTTPS for at least one of these instances. We currently have a certificate for http://applications.ourcompany.com。非常感谢任何帮助或指导。

您必须使用自定义代理服务器来执行此操作。路径 ('/appone', '/apptwo') 被传递给应用程序,而不是由 DNS 检查。所以你可以在 http://applications.ourcompany.com and have it proxy requests to the different apps on https://appone.elastibeanstalk.com 上设置 HAProxy 服务器或 nginx 或其他东西(注意我在那里添加了 HTTPS)。