I've set up a simple router with rule PathPrefix(`/me`)
but requests are not routed and instead I get
Gateway Timeout
(E.g. by calling http://my-server-name.com/me/
)
Does anyone have an idea why it is not working? Any suggestions are welcome
What is working is http://my-server-name.com:8000/me/
so the service (nginx
server) is up and running correctly; only the routing is not working.
A minimal (non-)working example is: docker-compose.yml
:
version: '3'
services:
traefik:
image: traefik:v2.0.5
ports:
- 80:80
- 443:443
- 8080:8080 # traefik GUI
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.yml:/etc/traefik/traefik.yml
restart: always
networks:
- webgateway
nginx:
image: nginx
ports:
- 8000:80
volumes:
- /home/user/html/:/usr/share/nginx/html:ro
restart: always
labels:
# traefik basic
- "traefik.enable=true"
- "traefik.docker.network=webgateway"
# traefik actual router
- "traefik.http.routers.testr.entrypoints=web"
- "traefik.http.routers.testr.rule=PathPrefix(`/me`)"
# traefik service
- "traefik.http.services.tests.loadbalancer.server.port=80"
networks:
webgateway:
driver: bridge
traefik.yml
:
entryPoints:
web:
address: ':80'
web-secure:
address: ':443'
traefik:
address: ':8080'
providers:
docker:
watch: true
exposedByDefault: false
api:
insecure: true
dashboard: true
debug: true
log:
level: DEBUG
(I've also tried playing with port like traefik.http.services.tests.loadbalancer.server.port=8000
etc, but it was pointed out to me in "Non-existent resolver: using docker + letsencrypt in static config" that it should be 80
)