Hello dear traefik community,
I am running (among other things) a selfhosted nextcloud instance behind traefik everthing works fine as long as I access everything from the WAN. But I dont always want to send packages on a journey when start and end is inside my LAN. Sadly my router does not support hairpinning and does not recognize packages originating and terminating in my LAN.
My (not working) solution was to run a pihole locally which resolves my domain to the local address. This is working and I can dig/nslookup/ping my domain and I get the local ip.
Once I enter the domain in the browser I can see in the pihole logs that the domain is being resolved but there is nothing in the traefik access logs and I end up in an infinite loading loop in the browser. Since the lookup is working I do not know what the problem is and why the packages don't seem to reach traefik.
The pihole is not behind traefik.
This is my docker-compose for treafik:
version: '3'
services:
traefik:
# The official v2 Traefik docker image
image: traefik:v2.11
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
# Enables the web UI and tells Traefik to listen to docker
command:
--api.insecure=true
--providers.docker
--logLevel=DEBUG
--accesslogi=true
domainname: "mydomain.com"
networks:
- proxy
- nextcloud-aio
ports:
# The HTTP port
- "80:80"
- "443:443"
# The Web UI (enabled by --api.insecure=true)
- "9080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /etc/localtime:/etc/localtime
- /var/run/docker.sock:/var/run/docker.sock
- /root/traefik/data/traefik.yml:/traefik.yml:ro
- /root/traefik/data/acme.json:/acme.json
- /root/traefik/data/config.yml:/config.yml:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.entrypoints=http"
- "traefik.http.routers.traefik.rule=Host(`traefik.mydomain.com`)"
- "traefik.http.middlewares.traefik-auth.basicauth.users=user:password"
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https"
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
- "traefik.http.routers.traefik-secure.entrypoints=https"
- "traefik.http.routers.traefik-secure.rule=Host(`traefik.mydomain.com`)"
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.certresolver=netcup"
- "traefik.http.routers.traefik-secure.tls.domains[0].main=mydomain.com"
- "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.mydomain.com"
- "traefik.http.routers.traefik-secure.service=api@internal"
networks:
proxy:
external: true
nextcloud-aio:
external: true
aswell as my traefik,yaml
global:
checkNewVersion: true
sendAnonymousUsage: true
api:
dashboard: true
debug: true
log:
level: DEBUG
accessLog: {}
entryPoints:
http:
address: ":80"
http:
redirections:
entryPoint:
to: https
scheme: https
https:
address: ":443"
serversTransport:
insecureSkipVerify: true
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
file:
filename: /config.yml
certificatesResolvers:
netcup:
acme:
... unrelated to the issue ...
Any idea how do debug this further?
Thanks in advance!