Hello, How can apply it to delete and post operations and do not apply it to the get.
Currently any action requires authentication
labels:
- "traefik.http.middlewares.service-auth.forwardauth.address=http://auth_service.localhost/authService"
- "traefik.http.routers.crud_service.middlewares=service-auth"
- "traefik.http.routers.crud_service.entrypoints=web"
- "traefik.http.routers.crud_service.rule=Host(`crud_service.localhost`)"
- "traefik.http.services.crud_service.loadbalancer.server.port=3010"
I don't think that is possible with Traefik. You could use different URLs with different services. But in my opinion it's either all or nothing. If you need to differentiate, this should probably be done inside your application.
sosoba
November 2, 2022, 4:04am
3
You can create two routers.
labels:
- "traefik.http.routers.r_service.rule=Host(`crud_service.localhost`)"
- "traefik.http.routers.cud_service.rule=Host(`crud_service.localhost`) && Method(`DELETE`, `POST`)"
- "traefik.http.routers.cud_service.middlewares=service-auth"
2 Likes
Thank you for your answer.
system
Closed
November 25, 2022, 9:15pm
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.