Hey!
Thanks for your reply! The second posting is much stripped down version of my original configuration, that's why pihole and homeassistant are not included. Sorry, I failed to make that clear.
I now have it running for home assistant on the root directory. Next thing I try is to route the traefik/
subdirectory to the api@internal
service.
Currently, my relevant configuration is
http:
routers:
homeassistant:
rule: "Host(`home.xgm.de`)"
service: homeassistant
priority: 1
tls:
certResolver: le
traefik:
rule: "PathPrefix(`/traefik`)"
service: api@internal
priority: 2
tls:
certResolver: le
# middleware:
# - test-stripprefix
middlewares:
test-stripprefix:
stripPrefix:
prefixes:
- "/traefik/"
services:
homeassistant:
loadBalancer:
servers:
- url: "http://192.168.0.2:8123"
This results in a log output upon requesting http://home.xgm.de/traefik
:
traefik | 46.114.58.140 - - [10/Aug/2020:17:35:23 +0000] "GET /traefik HTTP/1.1" 301 17 "-" "-" 1 "http-to-https@internal" "-" 0ms
traefik | 46.114.58.140 - - [10/Aug/2020:17:35:24 +0000] "GET /traefik HTTP/2.0" 404 19 "-" "-" 2 "traefik@file" "-" 0ms
traefik | time="2020-08-10T17:35:24Z" level=debug msg="vulcand/oxy/roundrobin/rr: begin ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/favicon.ico\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\"},\"Proto\":\"HTTP/2.0\",\"ProtoMajor\":2,\"ProtoMinor\":0,\"Header\":{\"Accept\":[\"image/webp,image/apng,image/*,*/*;q=0.8\"],\"Accept-Encoding\":[\"gzip, deflate, br\"],\"Accept-Language\":[\"de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7\"],\"Referer\":[\"https://home.xgm.de/traefik\"],\"Sec-Fetch-Dest\":[\"image\"],\"Sec-Fetch-Mode\":[\"no-cors\"],\"Sec-Fetch-Site\":[\"same-origin\"],\"User-Agent\":[\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36\"],\"X-Forwarded-Host\":[\"home.xgm.de\"],\"X-Forwarded-Port\":[\"443\"],\"X-Forwarded-Proto\":[\"https\"],\"X-Forwarded-Server\":[\"marduk\"],\"X-Real-Ip\":[\"46.114.58.140\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"home.xgm.de\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"46.114.58.140:37280\",\"RequestURI\":\"/favicon.ico\",\"TLS\":null}"
traefik | time="2020-08-10T17:35:24Z" level=debug msg="vulcand/oxy/roundrobin/rr: Forwarding this request to URL" ForwardURL="http://192.168.0.2:8123" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/favicon.ico\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\"},\"Proto\":\"HTTP/2.0\",\"ProtoMajor\":2,\"ProtoMinor\":0,\"Header\":{\"Accept\":[\"image/webp,image/apng,image/*,*/*;q=0.8\"],\"Accept-Encoding\":[\"gzip, deflate, br\"],\"Accept-Language\":[\"de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7\"],\"Referer\":[\"https://home.xgm.de/traefik\"],\"Sec-Fetch-Dest\":[\"image\"],\"Sec-Fetch-Mode\":[\"no-cors\"],\"Sec-Fetch-Site\":[\"same-origin\"],\"User-Agent\":[\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36\"],\"X-Forwarded-Host\":[\"home.xgm.de\"],\"X-Forwarded-Port\":[\"443\"],\"X-Forwarded-Proto\":[\"https\"],\"X-Forwarded-Server\":[\"marduk\"],\"X-Real-Ip\":[\"46.114.58.140\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"home.xgm.de\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"46.114.58.140:37280\",\"RequestURI\":\"/favicon.ico\",\"TLS\":null}"
when I enable the stripprefix middleware it becomes:
traefik | 46.114.58.140 - - [10/Aug/2020:17:40:07 +0000] "GET /traefik HTTP/2.0" 404 19 "-" "-" 3 "traefik@file" "-" 0ms
traefik | time="2020-08-10T17:40:07Z" level=debug msg="vulcand/oxy/roundrobin/rr: begin ServeHttp on request" Request="{\"Method\":\"GET\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/favicon.ico\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\"},\"Proto\":\"HTTP/2.0\",\"ProtoMajor\":2,\"ProtoMinor\":0,\"Header\":{\"Accept\":[\"image/webp,image/apng,image/*,*/*;q=0.8\"],\"Accept-Encoding\":[\"gzip, deflate, br\"],\"Accept-Language\":[\"de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7\"],\"Cache-Control\":[\"no-cache\"],\"Pragma\":[\"no-cache\"],\"Referer\":[\"https://home.xgm.de/traefik\"],\"Sec-Fetch-Dest\":[\"image\"],\"Sec-Fetch-Mode\":[\"no-cors\"],\"Sec-Fetch-Site\":[\"same-origin\"],\"User-Agent\":[\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36\"],\"X-Forwarded-Host\":[\"home.xgm.de\"],\"X-Forwarded-Port\":[\"443\"],\"X-Forwarded-Proto\":[\"https\"],\"X-Forwarded-Server\":[\"marduk\"],\"X-Real-Ip\":[\"46.114.58.140\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"home.xgm.de\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"46.114.58.140:37364\",\"RequestURI\":\"/favicon.ico\",\"TLS\":null}"
Do you have any advise for me?
Thanks!