mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-02-24 01:38:15 +00:00
Support containers running --net=host (#1537)
Detect if a target container is running host networking, and if so, use the IP address of the first bridge net gateway.
This commit is contained in:
parent
b4efff04b7
commit
325fd01ebb
@ -67,6 +67,11 @@
|
|||||||
# {{ .Name }} (ignored)
|
# {{ .Name }} (ignored)
|
||||||
{{- continue }}
|
{{- continue }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if eq .Name "host" }}
|
||||||
|
# {{ .Name }} (host network; using {{ (index $.globals.CurrentContainer.Networks 0).Name }} gateway)
|
||||||
|
{{- $ip = (index $.globals.CurrentContainer.Networks 0).Gateway }}
|
||||||
|
{{- continue }}
|
||||||
|
{{- end }}
|
||||||
{{- if and (not (index $.globals.networks .Name)) (not $.globals.networks.host) }}
|
{{- if and (not (index $.globals.networks .Name)) (not $.globals.networks.host) }}
|
||||||
# {{ .Name }} (unreachable)
|
# {{ .Name }} (unreachable)
|
||||||
{{- continue }}
|
{{- continue }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user