-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No upstreams generated when container has it's own IP #1937
Labels
kind/bug
Issue reporting a bug
Comments
I solved this by this patch to support diff --git a/nginx.tmpl b/nginx.tmpl
index 610edf1..919c05d 100644
--- a/nginx.tmpl
+++ b/nginx.tmpl
@@ -135,6 +135,12 @@ location {{ .Path }} {
{{ end }}
{{ end }}
{{ end }}
+ {{ range $container := .Containers }}
+ {{ if $container.Env.VIRTUAL_ADDRESS }}
+ {{ $server_found = "true" }}
+ server {{ $container.Env.VIRTUAL_ADDRESS }}:{{ $container.Env.VIRTUAL_PORT }};
+ {{ end }}
+ {{ end }}
{{/* nginx-proxy/nginx-proxy#1105 */}}
{{ if (eq $server_found "false") }}
# Fallback entry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have containers with their own IPs assigned (so they are not using the host network), the IP is not detected and VIRTUAL_PORT is ignored. Would be great to at least set upstream by an environment variable.
The text was updated successfully, but these errors were encountered: