Selectively disable BasicAuth Middleware

Hey there,

my docker-compose nginx labels are looking like this right now:

labels:
    - "traefik.http.routers.myRouter.rule=Host(`${SYSTEM_HOST}`)"
    - "traefik.http.routers.myRouter.entrypoints=http,https"
    - "traefik.http.routers.myRouter.middlewares=myAuth"
    - "traefik.http.middlewares.myAuth.basicauth.users=${BASIC_AUTH}"

We're using .env files on our live and staging systems to determine if we need e.g. basic auth.

When using Traefik 1.7 we could just supply an empty string in BASIC_AUTH to disable the basic auth for that frontend.
Thats not working when using Traefik 2.

Is there any way to mimic that behaviour in Traefik 2, without the need to change the docker-compose file per environment?

Add another set of router labels without the middleware.
The rule would need to have higher priority (implicit by rule length or explicit via priority label).

labels:
            - "traefik.http.routers.myRouter.rule=Host(`${SYSTEM_HOST}`)"
            - "traefik.http.routers.myRouter.entrypoints=http,https"
            - "traefik.http.routers.myRouter.middlewares=myAuth"
            - "traefik.http.middlewares.myAuth.basicauth.users=${BASIC_AUTH}"
            - "traefik.http.routers.myRouterNoAuth.rule=(Host(`${SYSTEM_HOST}`) && PathPrefix(`/some/path/`))"
            - "traefik.http.routers.myRouterNoAuth.entrypoints=http,https"