# Add basicAuth middleware to path with regex

**URL:** <https://community.traefik.io/t/add-basicauth-middleware-to-path-with-regex/14507>\
**Category:** Traefik v2\
**Tags:** middleware\
**Created:** [May 18, 2022, 8:51pm UTC](https://community.traefik.io/t/add-basicauth-middleware-to-path-with-regex/14507 "2022-05-18T20:51:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lkeijser](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/lkeijser/32/5354_2.png) [@lkeijser](https://community.traefik.io/u/lkeijser)\
**Post date:** [May 18, 2022, 8:51pm UTC](https://community.traefik.io/t/add-basicauth-middleware-to-path-with-regex/14507/1 "2022-05-18T20:51:43Z")

</div>

I have some apps which expose an endpoint that I would like to protect using a basic auth middleware. I really don't want to configure each and every application (which has its own ingressRoute) seperately. So I'm looking for something that can match a path like this:

`^/.*/my-endpoint/.*`

Is this possible?
