我正在尝试使用Traefik将我的流量重定向到我的LXC上的正确网络服务器,具体取决于网址中的子域。
示例:
- cloud.mydomain.com => 192.168.1.206
- blog.mydomain.com => 192.168.1.207
我只有一个静态公共IP,我希望Traefik接收所有80/443请求,并将它们重定向到正确的网络服务器上(所有这些都在相同的硬件上但在不同的LXC中)。
以下是我当前的配置。这是我第一次使用Traefik,所以如果我犯了一些愚蠢的错误,我很抱歉。
我得到的只是404错误。我不确定我的配置文件有什么问题。
我是否需要在Apache服务器端设置一些特殊的东西?
debug = true
logLevel = "DEBUG"
[api]
defaultEntryPoints = ["http", "https"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
certFile = "/etc/pve/local/pveproxy-ssl.pem"
keyFile = "/etc/pve/local/pveproxy-ssl.key"
[file]
[backends]
[backends.backendCloud]
[backends.backendCloud.servers.server1]
url = "https://192.168.1.206:443/nextcloud"
weight = 1
[backends.backendConsole]
[backends.backendConsole.servers.server1]
url = "https://192.168.1.200:8006"
weight = 1
[backends.backendGame]
[backends.backendGame.servers.server1]
url = "https://192.168.1.207:443"
weight = 1
[frontends]
[frontends.frontendCloud]
backend = "backendCloud"
[frontends.frontendCloud.routes.test_1]
rule = "Host:cloud.mydomain.com"
[frontends.frontendGame]
backend = "backendGame"
[frontends.frontendGame.routes.test_1]
rule = "Host:game.mydomain.com"
[frontends.frontendConsole]
backend = "backendConsole"
[frontends.frontendConsole.routes.test_1]
rule = "Host:console.mydomain.com"
[ping]