mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-06-30 22:05:46 +00:00
feat: handle multiple proxy networks
This commit is contained in:
13
nginx.tmpl
13
nginx.tmpl
@ -68,9 +68,16 @@
|
||||
{{- continue }}
|
||||
{{- end }}
|
||||
{{- if eq .Name "host" }}
|
||||
# {{ .Name }} (host network; using {{ (index $.globals.CurrentContainer.Networks 0).Name }} gateway)
|
||||
{{- $ip = (index $.globals.CurrentContainer.Networks 0).Gateway }}
|
||||
{{- continue }}
|
||||
{{- range sortObjectsByKeysAsc $.globals.CurrentContainer.Networks "Name" }}
|
||||
{{- if and . .Gateway }}
|
||||
# container is in host network mode, using {{ .Name }} gateway IP
|
||||
{{- $ip = .Gateway }}
|
||||
{{- break }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $ip }}
|
||||
{{- continue }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and (not (index $.globals.networks .Name)) (not $.globals.networks.host) }}
|
||||
# {{ .Name }} (unreachable)
|
||||
|
Reference in New Issue
Block a user