Hi Community,
I have got a problem and won't find a solution (after reading the doc or searching for) . So I hope, someone can help me
I'm using Portainer at my local home server and want to use Traefik as a proxy, so I can reach my services like:
home.fritz.box/openhab
home.fritz.box/nodered
....
Like the documentation provides some samples with whoami, I have started with that:
version: '3.9'
services:
traefik:
image: traefik:v2.9.6
container_name: traefik
restart: always
# Enables the web UI and tells Traefik to listen to docker
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
# The HTTP port
- 80:80
# The HTTPS / TLS port
- 443:443
# The Web UI (enabled by --api.insecure=true)
- 8080:8080
networks:
- home-proxy-network
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- traefik-volume:/etc/traefik
...
services:
whoami:
image: traefik/whoami
container_name: whoami
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`home.fritz.box`)"
- "traefik.http.routers.whoami.rule=Path(`/whoami`)"
- "traefik.http.routers.whoami.entrypoints=web"
networks:
- home-proxy-network
...
And it works as expected
So the next step is to configure it for openhab / node-red.
Here the compose file:
version: "3.9"
services:
nodered:
image: nodered/node-red:3.0.2
container_name: nodered
restart: always
environment:
- TZ=Europe/Berlin
labels:
- "traefik.enable=true"
- "traefik.http.routers.nodered.rule=Host(`home.fritz.box`) && Path(`/nodered`)"
- "traefik.http.routers.nodered.entrypoints=web"
- "traefik.http.services.nodered.loadbalancer.server.port=1880"
networks:
- home-proxy-network
volumes:
- node-red-volume:/data
The challenge here is, that the requests needs to be forwarded to the port 1880, so I have used the "traefik.http.services.nodered.loadbalancer.server.port" option.
But it wont work!
I only get:
Cannot GET /nodered
If I wont set the PATH rule, then it works and I can reach node-red under home.fritz.box. But that is not, what I want.
...
labels:
- "traefik.enable=true"
- "traefik.http.routers.nodered.rule=Host(`home.fritz.box`)"
- "traefik.http.routers.nodered.entrypoints=web"
- "traefik.http.services.nodered.loadbalancer.server.port=1880"
...
The same for openhab.
Is it not possibe to use the PATH rule in combination with the loadbalancer.server.port option?
Who can help?
Cheers!
Christian