mirror of
https://github.com/thib8956/nginx-proxy
synced 2024-11-22 20:06:30 +00:00
Fallback if container has no IP
Sometimes containers will not be assigned an IP (after reboot or due to misconfiguration). This leads to an incorrect "server <missing ip> down;" line in default.conf and crashes nginx. @therealgambo provided a fix for this: https://github.com/jwilder/nginx-proxy/issues/845
This commit is contained in:
parent
f05f7a0ff9
commit
3156b97f3a
@ -13,8 +13,13 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
{{ else if .Network }}
|
{{ else if .Network }}
|
||||||
# {{ .Container.Name }}
|
# {{ .Container.Name }}
|
||||||
|
{{ if .Network.IP }}
|
||||||
server {{ .Network.IP }} down;
|
server {{ .Network.IP }} down;
|
||||||
|
{{ else }}
|
||||||
|
server 127.0.0.1 down;
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
|
# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
|
||||||
|
Loading…
Reference in New Issue
Block a user