I have traefik dashboard working. I can access it via traefik.example.xyz.
But when I enter my public ip address or my local ip address I get a 404 page not found. It doesn't redirect.
I would like to be able to access traefik via ip address both local and public.
Why would I want to do this?
The hairpinning/NAT Loopback on my router sucks. I want to be able to access traefik at home via local network so I can actually use it. In addition, having the local ip address would allow me to add 192.168.0.108 traefik.example.xyz traefik
to my /etc/pihole/lan.list
I appreciate your help and I'll try to adapt to the single file. I've heard opposite (i.e. separation of files) is better, but whatever.
I'm getting an erro that saying:
level=error msg="Unable to obtain ACME certificate for domains \"traefik.example.xyz\": cannot get ACME client ACME challenge not specified, please select TLS or HTTP or DNS Challenge" rule="Host(`traefik.example.xyz`)" providerName=le.acme routerName=traefik@docker
lol, hard to argue against that. Just as a learning opertunity, did you turn my traefik.yml to the command label?
Sorry I did mean to say I did copy and paste your code and changed email and domain names. That's the error I got afterwards. You can see in the error it mentions
providerName=le.acme
which I believe is the name given to the new commands.
Your solution is working. I had to change the challenge to DNS challenge as I was getting an IP issue, so I added all the cloudflare stuff. I am getting a https secure padlock for my dashboard?
Before I mark as solved. How do I access traefik.localdomain? When I type traefik.localdomain in firefox it tried to resolve as www.traefik.localdomain. And when I ping traefik.localdomain I get nothing.
Sorry I'm a bit confused how this would work in my /etc/pihole/lan.list which is where I would put the dns entry. /etc/pihole/lan.list looks like
192.168.1.40 marvin.your.lan marvin
Where the IP is the first entry (hence my first question).
I tried to put
traefik.localdomain traefik
in my /etc/pihole/lan.list rile and then pihole restartdns but still pinging it gives "Name or service not known". I'm confused in the execution of the DNS entry because I'm only familiar with mapping it to an IP.
So is it not possible to do this? Can I not have traefik work with a local ip? That kinda sucks.
I've been trying to do this for almost 2 weeks now, and it's driving me nuts.
Accessing traefik only works through traefik.example.xyz
When accessing it through the server IP address (both locally and externally) traefik gives a 404 page, hence asking the question in the first place. I can't access traefik through the IP address, otherwise I would have put that in the host file, hence asking in the first place.
That's why I've been asking "how to access traefik via ip address" because I want to put that in my host file, however, when accessing through the IP address (not the published domain) there's a 404 page, hence why I can't resolve it.
As you have been advised you need a dns or hosts entry. The lack of knowing what ip address to use is your issue, not traefik's or mine.
The ip address will be that of the docker host, unless you are doing some non-default docker networking.
Your rules do not match ip addresses, only hostnames. Hence a 404.
You'll see the difference via curl:
curl -i http://192.168.1.2
HTTP/1.1 404 Not Found
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Fri, 21 Aug 2020 12:29:57 GMT
Content-Length: 19
404 page not found