从 URL 中消除 8080
Eliminating 8080 from a URL
我已经在负载均衡器后面的 AWS 中部署了我的服务
如果我点http://subdomain.myservice.com to the DNS name of the AWS load balancer using a CNAME record, I can get my service respond to requests at 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"
利用您的负载平衡器侦听端口。进入您的负载均衡器侦听器选项卡。在负载均衡器的 80 端口上添加一个新的侦听器,并将其发送到实例的 8080 端口。
完成后,您的负载均衡器将在 http://subdomain.myservice.com 侦听默认端口 80,然后将这些请求转发到您的 docker 容器所在的端口 8080 以处理请求。
我已经在负载均衡器后面的 AWS 中部署了我的服务
如果我点http://subdomain.myservice.com to the DNS name of the AWS load balancer using a CNAME record, I can get my service respond to requests at 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"
利用您的负载平衡器侦听端口。进入您的负载均衡器侦听器选项卡。在负载均衡器的 80 端口上添加一个新的侦听器,并将其发送到实例的 8080 端口。
完成后,您的负载均衡器将在 http://subdomain.myservice.com 侦听默认端口 80,然后将这些请求转发到您的 docker 容器所在的端口 8080 以处理请求。