Allow setting trusted proxies per entrypoint
This commit is contained in:
parent
4ead786c8f
commit
1ee95c47a1
|
@ -2,6 +2,7 @@ job "traefik" {
|
|||
|
||||
|
||||
datacenters = ["dc1"]
|
||||
region = "global"
|
||||
priority = 70
|
||||
|
||||
|
||||
|
|
|
@ -15,9 +15,13 @@ entryPoints:
|
|||
[[- if or (not (has $def "enabled")) ($def.enabled) ]]
|
||||
[[ $name ]]:
|
||||
address: ":{{ env "NOMAD_PORT_[[ $name | regexp.Replace "[\\.\\-]" "_" ]]" }}[[ if has $def "protocol" ]]/[[ $def.protocol ]][[ end ]]"
|
||||
[[- if gt (len $.traefik.trusted_proxies) 0 ]]
|
||||
[[- $trusted_proxies := $.traefik.trusted_proxies ]]
|
||||
[[- if has $def "trusted_proxies" ]]
|
||||
[[- $trusted_proxies = $def.trusted_proxies ]]
|
||||
[[- end ]]
|
||||
[[- if gt (len $trusted_proxies) 0 ]]
|
||||
proxyProtocol:
|
||||
trustedIPs:[[ range $idx, $ip := $.traefik.trusted_proxies ]]
|
||||
trustedIPs:[[ range $idx, $ip := $trusted_proxies ]]
|
||||
- [[ $ip ]][[ end ]]
|
||||
[[- end ]]
|
||||
[[- if has $def "http" ]]
|
||||
|
|
Loading…
Reference in New Issue