如何解决Docker 组合 ECS AWS 应用负载平衡重定向
我正在通过我的 docker compose 文件部署我的 docker 容器。
当我最初部署我的应用程序时,它会创建一个负载均衡器,但类型为“网络”。我无法使用这种类型重定向到 https。
我希望将我的负载均衡器创建为“应用程序”类型,然后设置从 http 到 https 的重定向。
我的容器仍将侦听端口 80。
奖励:我想部署并将我的 SSL 证书附加到我的撰写文件中,以便在全新部署时一切就绪。
正如你所看到的,我尝试了一些东西,但无法让它工作。
谢谢
version: '3.8'
services:
web:
container_name: auction_web
image: <ECR Image>
# x-aws-pull_credentials: arn:aws:secretsmanager:xxxxxxxxxxxx
depends_on:
- redis
ports:
# - "80:80" - tried this
# - "443:443" - tried this
- target: 80
x-aws-protocol: http
- target: 443
x-aws-protocol: https
# - published: 80
# protocol: "http"
# x-aws-alb-default-actions:
# - type: redirect
# host: '<domain>'
# port: 443
# protocol: HTTPS
# status-code: HTTP_301
# - published: 443
# protocol: "https"
# x-aws-acm-certificate: <cert name>
deploy:
resources:
limits:
cpus: '1'
memory: 4096M
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。