Running behind traefik reverse proxy #317
-
Hi everyone, I'm trying to run the Problem is: A similar issue has been addressed in this post but I think the workaround proposed there (a) wouldn't work with Here is my
I think the best solution would be to introduce a environment variable to the Has anyone made Let me know, if you need any more logs or data to assess. Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 17 comments 8 replies
-
I have this in my nginx proxy config for my omada service. Not sure if you can get traefik to do something similar:
|
Beta Was this translation helpful? Give feedback.
-
Looking at the thread you linked, those connector properties in 3.2 are the equivalent of the values in the @gca3020 looks to be on to something. The |
Beta Was this translation helpful? Give feedback.
-
Possibly |
Beta Was this translation helpful? Give feedback.
-
The web behavior of V5 is different from the V4, I noticed that after I upgraded to the V5 the URI of the http request has changed and now includes the ID of the omadac. I'm also using Traefik but with a combination of static and dynamic configs. I've the Omadac in an LXC container but I'm using the Traefik in docker. The http request to the Omadac needs to have the Host header with the required https port, and the URI of the http request must be rewritten to include the omada instance ID. Here's the toml config I'm using, you can adapt it to docker labels.
I tried to do a regex rule to automatically get the Omada id from the http response but didn't find a way to do it. You can get the Omadac ID from the logs, cat /opt/tplink/EAPController/logs/server.log | grep OmadacVO (main] [] c.t.s.o.s.t.OmadacInitTask(149): succeed get default omadac OmadacVO(id=b0f63ab3712f12c80658ece29d8ed9dc, name=wlc1) |
Beta Was this translation helpful? Give feedback.
-
The only other ways I have found to get the controller ID are: From the
From the API:
|
Beta Was this translation helpful? Give feedback.
-
@everyone: Thank you for your replies and hints. I'm going to be offline
for the next week and try them afterwards. Nonetheless it would be great
and much more straight forward if the redirect could be disabled.
CU
…On Wed, 19 Jan 2022 at 16:53, Matt Bentley ***@***.***> wrote:
The only other ways I have found to get the controller ID are:
From the Location: header on the login redirect:
$ curl -skI "https://omada.casa.mbentley.net/login" | grep "^Location: " | awk -F '/' '{print $4}'
f2c92c2a9b8fb0a427393f413bb16354
From the API:
$ curl -s "https://omada.casa.mbentley.net/api/info" | jq -r .result.omadacId
f2c92c2a9b8fb0a427393f413bb16354
—
Reply to this email directly, view it on GitHub
<#168 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUSYTH7HGIVECKC7VC4MEDUW3NAJANCNFSM5L4NPPUA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I was able to achieve reverse proxying by setting "HTTPS Port for Controller Management:" in the web-UI to 443, then recreating the container with the host in a different port than the container I'm using Nginx Proxy Manager, not traefik, but it worked without any further configuration there (listens on port 443 and connect to the container in port 8043). Of course, I can't login directly on port 8043 anymore, but that is expected. |
Beta Was this translation helpful? Give feedback.
-
I am going to close this for now since it seems like there are a few patterns that could work for people; feel free to reopen if you wish. If someone did want to submit a PR with a section on reverse proxy details for the README, we can add that. |
Beta Was this translation helpful? Give feedback.
-
Just to add to this, the missing piece for me here was that my Omada server's SSL certificate was self-signed and therefore untrusted by Traefik. I had to add the following lines to my
If you were using a configuration similar to @nickmaleao's, but got 500 errors, this might solve it. Other than that my configuration is very similar, just translated to use labels instead |
Beta Was this translation helpful? Give feedback.
-
For anyone interested in the docker labels to get this working:
replace all occurrences of |
Beta Was this translation helpful? Give feedback.
-
Can you tell me how you changed the port in the UI? I did the same but the controller won't let me set it to less than 1024. I would really appreciate it if you could share screenshots of the Nginx Proxy Manager settings as I also use it for my containers. But I can't seem to get it to work with this particular container. |
Beta Was this translation helpful? Give feedback.
-
I dont think this is the case with newer releases since the controller ID is added between the host and login |
Beta Was this translation helpful? Give feedback.
-
Wanted to pass an FYI, this is my currently-working config as of V5 and Traefik v2: http:
routers:
rtr-omada:
entryPoints:
- websecure
rule: "Host(`omada.url.com`)"
service: svc-omada
middlewares:
- mid-omada-redirectRegex
- mid-omada-headers
tls:
certResolver: letsencrypt
services:
svc-omada:
loadBalancer:
servers:
- url: "https://omada.lan:8043"
middlewares:
mid-omada-redirectRegex:
redirectRegex:
regex: "^https:\\/\\/([^\\/]+)\\/?$"
replacement: "https://$1/controller_id/login"
mid-omada-headers:
headers:
customRequestHeaders:
host: "omada.url.com:8043"
customResponseHeaders:
host: "omada.url.com Replace Also unsure if it matters, but I have |
Beta Was this translation helpful? Give feedback.
-
^^^ |
Beta Was this translation helpful? Give feedback.
-
This thread was very helpful for me. Thank you. I'm using Traefik in k3s, so I had to make a few adjustments. Here is my Kubernetes config in case anyone wants it. There are two services, one for http and a second for the ports. The ports are exposed through the k3s Load Balancer. Note, it's also using a SSL cert too.
|
Beta Was this translation helpful? Give feedback.
-
is there a easy to spin up docker compose example with traefik and lets encrypt ? |
Beta Was this translation helpful? Give feedback.
-
in system settings, I turned off "Redirect HTTP to HTTPS" + restarted the container, and that allows me to use my standard traefik config. |
Beta Was this translation helpful? Give feedback.
Wanted to pass an FYI, this is my currently-working config as of V5 and Traefik v2: