我已经使用 docker-compose 在 docker 下安装了 Traefik,并且使用了 rules.toml 文件来重定向某些请求。
Trafick 与安装在同一台 PC 上的其他 docker(使用 SSL)配合良好(它是 Qnap)
我想要的只是有一个重定向,例如: https://router.domain.com 这是我的 rules.toml
########################### BACKENDS ####################################
[backends]
##### Router
[backends.backend-router]
[backends.backend-router.servers]
[backends.backend-router.servers.server-router-ext]
url = "http://192.168.1.1:4443" ### https of router is set to 4443
weight = 0
#########################################################################
########################## FRONTENDS ####################################
[frontends]
##### Router
[frontends.frontend-router]
backend = "backend-router"
passHostHeader = true
[frontends.frontend-router.routes]
[frontends.frontend-router.routes.route-router-ext]
rule = "Host:router.domain.com"
这是我的 traefik.toml 文件
InsecureSkipVerify = true
defaultEntryPoints = ["https", "http"]
# WEB interface of Traefik - it will show web page with overview of frontend and backend configurations
[api]
entryPoint = "traefik"
dashboard = true
address = ":8080"
usersFile = "/shared/.htpasswd"
# Force HTTPS
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
##########################################################################
# file rules.toml
[file]
watch = true
filename = "/etc/traefik/rules.toml"
#############################
# Let's encrypt configuration
[acme]
email = "[email protected]"
storage="/etc/traefik/acme/acme.json"
entryPoint = "https"
acmeLogging=true
onDemand = false #create certificate when container is created
[acme.dnsChallenge]
provider = "cloudflare"
delayBeforeCheck = 0
InsecureSkipVerify = true
defaultEntryPoints = ["https", "http"]
# WEB interface of Traefik - it will show web page with overview of frontend and backend configurations
[api]
entryPoint = "traefik"
dashboard = true
address = ":8080"
usersFile = "/shared/.htpasswd"
# Force HTTPS
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
##########################################################################
# file rules.toml dove stanno i siti che non sono presenti nei vari docker
[file]
watch = true
filename = "/etc/traefik/rules.toml"
#############################
# Let's encrypt configuration
[acme]
email = "[email protected]"
storage="/etc/traefik/acme/acme.json"
entryPoint = "https"
acmeLogging=true
onDemand = false #create certificate when container is created
[acme.dnsChallenge]
provider = "cloudflare"
delayBeforeCheck = 0
当我尝试访问 Google Chrome 时出现以下信息:
the server responded with a status of 502 ()
有人能帮帮我吗?提前谢谢
丹尼斯