Fix traefik vhosts compose template

`auth` middleware label should only be added if `TRAEFIK_BASIC_AUTH` set
This commit is contained in:
Alexey Kharchenko
2023-07-13 12:01:20 +05:30
parent 55c57d049b
commit 3bbf5370da

View File

@@ -33,8 +33,8 @@ services:
- "traefik.http.routers.api.entrypoints={{ if $.TRAEFIK_LETSENCRYPT_EMAIL }}https{{ else }}http{{ end }}"
{{ end }}
- "traefik.http.routers.api.middlewares=auth"
{{ if $.TRAEFIK_BASIC_AUTH }}
- "traefik.http.routers.api.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users={{ $.TRAEFIK_BASIC_AUTH }}"
{{ end }}