Handle cases with a rule but no public_url
This commit is contained in:
parent
5903329a6d
commit
9f388a54d8
|
@ -26,10 +26,10 @@
|
|||
[[- end ]]
|
||||
|
||||
[[- $middlewares := coll.Slice ]]
|
||||
[[- if and (has . "public_url") (eq $proto "http") ]]
|
||||
[[- if eq $proto "http" ]]
|
||||
[[- if has .traefik "rule" ]]
|
||||
"[[ .traefik.instance ]].http.routers.[[ $router ]].rule=[[ .traefik.rule ]]",
|
||||
[[- else if .traefik.auto_rule ]]
|
||||
[[- else if and (has . "public_url") (.traefik.auto_rule) ]]
|
||||
"[[ .traefik.instance ]].http.routers.[[ $router ]].rule=Host(`[[ (urlParse .public_url).Hostname ]]`)
|
||||
[[- if not (regexp.Match "^/?$" (urlParse .public_url).Path) ]] && PathPrefix(`[[ (urlParse .public_url).Path | regexp.Replace "^//" "/" ]]`)[[ end ]]",
|
||||
[[- end ]]
|
||||
|
|
Loading…
Reference in New Issue
Block a user