: Disclaimer Traefik noob here
If I use my domain name, such as: portainer.domain.tld, I got a 526 SSL invalid certificate error or connection timed out, depending of what useless things I'm configuring.
So I tried with local domain name, but I got a ERR_CONNECTION_REFUSED error.
I tried several configurations, none of them worked. Here's my last attempt.
portainer.yml, running without problem:
My traefik.yml (not the configuration file), no apparent error in logs:
Finally, my treafik.yml (config file)
- certFile: /certs/cert.pem
If you need anything else, please, let me know.
Thanks to those who could help me
Okay, as It's very complicated for me, I made a more simple example, that still does not work
I set up a whoami container:
I simplified the Traefik too.
The YAML config file:
My router port forward from 80 to 49870 internal to try to reach Traefik.
I can make:
curl -H Host:whoami.domain.tld http://192.168.1.200:49870 (192.168.1.200 is the server where Traefik is)
GET / HTTP/1.1
But I can't, write whoami.domain.tld in a browser and not having an error
Whatever container Traefik should forward requests to, both should be placed within the same Docker network.
If the target service has multiple networks, set docker.network in static provider or dynamic router config.
Thanks for your reply.
The final version of my Traefik configuration will need to be able to cope with different Docker networks. For security first, and because I don't want to edit all my services to put them in a single network. No way.
For now, I just try to make Traefik work outside of my network (from a web browser typically).
I don't know what's wrong from this side. I use the same method as for Nginx, when my IP gets a request on port 443, It redirects it to my server, and then, the container takes care of the rest.
Here, Traefik doesn't seem to make anything.
You can have a different Docker network for every service, but Traefik needs to be part of it. Then use labels on your service to set according
Make sure your domain
whoami.domain.tld is set in DNS to resolve to the IP, either in Internet with a paid provider, in your Internet router or in your local hosts file.
It’s very confusing that you name your Traefik service „portainer“.
Shouldn't name my Traefik service "portainer"? In Traefik, It is showed as portainer@docker.
I don't understand why Traefik is capable of routing a request to a container while Nginx does (to a local IP + port) without problem.
I don't know what blocks Traefik.
Just stated that this was confusing to me, when I scanned over the config.
Even on trying on another machine, It does not work. I don't understand. Requests come because if I switch to 443, I have SSL invalid certificate error but on 80, It just loads. I tried with curl and I got a 301 error.
I think I'm ready to pay 5$ on PayPal to solve this shit, It's enough.
Looking again at your original post: not sure how portainer should work via Traefik, because they don’t share the same Docker network. Did you access it directly via the exposed
Traefik TLS files need to be configured in a “dynamic configuration”, so you need something like
traefik-dynamic.yml which you load in
traefik.yml with a
provider.file (next to
TLS docs, file docs.
And if you try accessing your app with curl and
https, you should expose the default ports
443 or add the ports to you curl request.
Okay, I found the answer ...
DNS record had a wrong address... because my ISP has dynamic IP...
February 15, 2023, 10:46am
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.