I want to make my Unifi Controller to be accessible through the web, however, no matter what I do (even if Traefik successfully loaded the configuration), it will always give me "Bad Gateway".
Logs telling me that uplink cannot be established (I guess this is due to the fact, that i have to proxy https://0.0.0.0:8443 instead of usual http://)
Controller is installed on my web server, not in Docker, and all ports are allowed for internal network with UFW.
I've created a separate file with configuration, which looks like this:
[backends]
[backends.unifi]
[backends.unifi.servers]
[backends.unifi.servers.server0]
url = "https://127.0.0.1:8443/"
weight = 1
[frontends]
[frontends.unifi]
entryPoints = ["https", "http"]
backend = "unifi"
passHostHeader = true
[frontends.unifi.routes]
[frontends.unifi.routes.route0]
rule = "Host:controller.website.example"
[frontends.unifi.headers]
SSLRedirect = true
STSSeconds = 315360000
browserXSSFilter = true
contentTypeNosniff = true
forceSTSHeader = true
SSLHost = "website.example"
STSIncludeSubdomains = true
STSPreload = true
frameDeny = true
It is stored in a separate file in the directory inside the traefik "rules" folder, which is loaded by this config inside the traefik.toml
[file]
directory = "/etc/traefik/rules/"
watch = true
And just some extra info:
- No, I cannot use http://0.0.0.0:8443, Unifi Controller will tell you that port is not matching the protocol
- Their 8880 port for redirects will not work as well, 400 error comes up
- I don't really want to use docker to run the controller (it took me 4 hours to configure the gateway (some nice reboot/provisioning loops are included)