there are web app and efk(elasticsearch + fluentd + kibana) stack in my docker-compose file. I want app working on localhost/api path and kibana on localhost on localhost/kibana path. The problem is app is working, kibana - not. I get 404 error. But if I run kibana on localhost without path it works fine.
web_app's code:
web_app:
build: .
volumes:
- .:/usr/src/app/volumes/web/
env_file:
- ./.env.dev
labels:
- "traefik.enable=true"
- "traefik.http.routers.web_app.rule=(Host(`localhost`) && Path(`/api`))"
- "traefik.http.middlewares.web_app-stripprefix.stripprefix.prefixes=/api,/api/"
- "traefik.http.routers.web_app.middlewares=web_app-stripprefix@docker"
- "traefik.http.services.web_app.loadbalancer.server.port=8081"
depends_on:
- reverse-proxy
- db
networks:
- traefik-public
and kibana's code here:
kibana:
image: kibana:7.2.0
links:
- "elasticsearch"
expose:
- "5601"
labels:
- "traefik.enable=true"
- "traefik.http.routers.kibana.rule=(Host(`localhost`) && Path(`/kibana`))"
- "traefik.http.middlewares.kibana-stripprefix.stripprefix.prefixes=/kibana,/kibana/"
- "traefik.http.routers.kibana.middlewares=kibana-stripprefix@docker"
- "traefik.http.services.kibana.loadbalancer.server.port=5601"
networks:
- traefik-public
and external network:
networks:
traefik-public:
external:
name: traefik-public