Change routing to use subdomains

This commit is contained in:
2025-04-29 20:14:58 +10:00
parent c158757661
commit aab7efb5c3
5 changed files with 69 additions and 38 deletions

View File

@@ -13,6 +13,13 @@ job "traefik" {
service {
name = "traefik"
tags = [
"traefik.enable=true",
"traefik.http.routers.traefik.rule=Host(`traefik.othrayte.one`)",
"traefik.http.routers.traefik.service=traefik",
"traefik.http.services.traefik.loadbalancer.server.port=8081",
]
check {
name = "alive"
type = "tcp"
@@ -30,33 +37,61 @@ job "traefik" {
network_mode = "host"
volumes = [
"local/traefik.toml:/etc/traefik/traefik.toml",
"local/traefik.yml:/etc/traefik/traefik.yml",
"local/configs/:/etc/traefik/configs/",
]
}
template {
data = <<EOF
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.traefik]
address = ":8081"
entryPoints:
http:
address: ":80"
traefik:
address: ":8081"
[api]
dashboard = true
insecure = true
api:
dashboard: true
insecure: true
# Enable Consul Catalog configuration backend.
[providers.consulCatalog]
prefix = "traefik"
exposedByDefault = false
providers:
file:
directory: "/etc/traefik/configs/"
[providers.consulCatalog.endpoint]
address = "127.0.0.1:8500"
scheme = "http"
consulCatalog:
prefix: "traefik"
exposedByDefault: false
endpoint:
address: "127.0.0.1:8500"
scheme: "http"
EOF
destination = "local/traefik.toml"
destination = "local/traefik.yml"
}
template {
data = <<EOF
http:
routers:
nomadui:
rule: "Host(`nomad.othrayte.one`)"
service: nomadui
consului:
rule: "Host(`consul.othrayte.one`)"
service: consului
services:
nomadui:
loadBalancer:
servers:
- url: "http://127.0.0.1:4646"
consului:
loadBalancer:
servers:
- url: "http://127.0.0.1:8500"
EOF
destination = "local/configs/nomad.yml"
}
resources {