步骤1 实现 https 协议访问 helloworld 应用
app:
ports:
- 80/tcp
image: 'registry.cn-hangzhou.aliyuncs.com/linhuatest/hello-world:latest'
labels:
# 此处只是 http/https/ws/wss 协议
aliyun.routing.port_80: "http://www.example.com"
restart: always
2. 配置好负载均衡之后,参见简单路由-HTTP 协议变为 HTTPS 协议,访问 HTTPS 协议的网站如下所示。

user nginx;error_log /var/log/nginx/error.log warn;pid /var/run/nginx.pid;events { worker_connections 65535;}http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; keepalive_timeout 65; gzip on; server { listen 80; server_name localhost; return 301 https://$host$request_uri; }}nginx: ports: - 80:80/tcp # 映射到主机的 80 端口 image: 'nginx:latest' labels: aliyun.global: true # 每台机器均部署一个 nginx 容器,达到高可用目的 volumes: - /ngx/nginx.conf:/etc/nginx/nginx.conf restart: always版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。