thanks, it's works!
But I have a problem with https, it's work only with http. But I change the routers rule with a subdomain it's work with https. I need both https and http. All other services (pgadmin, ngix etc..) in docker-compose works under https with patprefix rule.
do you know it there are some other requirements?
You have to define separate routers, one for http and one for https.
More common is to redirect http to https and just define the one router for your service.
- "traefik.enable=true"
- "traefik.docker.network=livenet-network"
# https router
- "traefik.http.routers.livenet-api.rule=Host(`ln-server.loc`) && PathPrefix(`/api/v1`)"
- "traefik.http.routers.livenet-api.tls=true"
- "traefik.http.routers.livenet-api.entrypoints=websecure"
- "traefik.http.routers.livenet-api.middlewares=livenet-api-stripprefix"
#http router (different name for the router)
- "traefik.http.routers.livenet-api-http.rule=Host(`ln-server.loc`) && PathPrefix(`/api/v1`)"
- "traefik.http.routers.livenet-api-http.entrypoints=web"
- "traefik.http.routers.livenet-api-http.middlewares=livenet-api-stripprefix"
# middleware
- "traefik.http.routers.livenet-api.middlewares=livenet-api-stripprefix"
- "traefik.http.middlewares.livenet-api-stripprefix.stripprefix.prefixes=/api/v1"
# not needed, this is implicit as it the label on the servive
# - "traefik.http.routers.livenet-api.service=livenet-api"
# this is only needed if your service exposes more than one port (or none)
# i.e. if the container exposes 3000 this line is not needed
- "traefik.http.services.livenet-api.loadbalancer.server.port=3000"
#- "traefik.http.middlewares.livenet-api-https.redirectscheme.scheme=https"
Thanks,
but on https still get 404. Traefik tells me that it works properly (there are no errors in dashboard).
it's very frustrating because all the other services work properly and I don't understand what the problem is on reverse proxy