1
0
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:
Nicolas Duchon
2023-05-09 00:58:05 +02:00
parent 882e9a3b3c
commit b88d33d2f3
2 changed files with 14 additions and 4 deletions

View File

@ -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)