【发布时间】:2018-03-28 02:58:42
【问题描述】:
我已在 AWS 中的负载均衡器后面部署了我的服务
如果我使用 CNAME 记录将 http://subdomain.myservice.com 指向 AWS 负载均衡器的 DNS 名称,我可以让我的服务响应 http://subdomain.myservice.com/8080 的请求
但我希望它可以在 http://subdomain.myservice.com 工作
我已尝试创建一条 CNAME 记录,将 http://subdomain.myservice.com 指向 AWS 负载均衡器的 DNS 名称,并在末尾添加 :8080,但它不起作用。
我该怎么做?
这是服务的 Docker-compose 文件
version: "2"
services:
api:
image: my_java_service
ports:
- "8080:8080"
links:
- mongo
mongo:
image: mongo_db
ports:
- "27017:27017"
【问题讨论】:
-
如果你改变
ports:- "8080:8080"这一行,它会改变服务监听的端口吗?
标签: amazon-web-services dns docker-compose url-redirection cname