traefik中如何用docker-compose设置TLS13
要在Traefik中使用Docker Compose设置TLS 1.3,您需要执行以下步骤:
- 在Traefik配置文件中启用TLS 1.3支持。要这样做,请在配置文件的[entryPoints]部分中将tls的最小版本设置为"VersionTLS13",如下所示:
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.web.http.redirections.entryPoint]
to = "websecure"
scheme = "https"
[entryPoints.websecure]
address = ":443"
[entryPoints.websecure.http.tls]
minVersion = "VersionTLS13"
- 在Docker Compose文件中将Traefik容器的TLS选项设置为“true”,如下所示:
version: '3.8'
services:
traefik:
image: traefik:v2.5
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedByDefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.websecure.http.tls=true"
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- 运行Docker Compose文件以启动Traefik容器。在容器运行后,您应该能够使用TLS 1.3启动HTTPS连接。
请注意,使用TLS 1.3需要Traefik和客户端浏览器都支持该协议。如果您的浏览器不支持TLS 1.3,则无法建立TLS 1.3连接。
原文地址: http://www.cveoy.top/t/topic/bfGQ 著作权归作者所有。请勿转载和采集!