-
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
Get IP Address Upstream #164
Comments
I actually think I see smaller problem now is related to: for
but I'm still trying to understand why I have the error with '{'
when running:
As when I run docker-gen locally it generates the file correctly. |
The problem is that the files under As for nginx-proxy/docker-gen#79, it's not related, though it is something you'd probably want to use for your use case if custom templates actually were supported. |
The discussion starting at this comment is also relevant: #106 (comment) |
@md5 thanks for clarifying and the help. I was a little confused by that file in the root of the repo but I see now it works with Docker-gen. |
So with fresh eyes this morning I figured out my problems for anyone else who may find this.
My new docker run command is
This is now working as needed for us and we are able to have multiple nginx locations reverse proxied to the one or many containers. |
@mjaverto Regarding your second point, I just opened a PR to always expose the container's address: nginx-proxy/docker-gen#86 |
Great project, I hope you can help me with a small piece and I can contribute back for others in our scenario.
We are running self-contained spring boot jars that spin up a Tomcat server on 8080 per container. We need to reverse proxy back to the respective container based on NGINX locations. This project seems to be perfect for what we need but the only issue I run into is getting the container address, {{ $address.IP }}.
The error I get is on the upstream line:
as seen here when DOCKER_CONTAINER is an env correctly set for the container.
I've tried editing many different ways and it seems like {{ $host }} is returning the env variable but I can't seem to get
working even if I remove the upstream {{ $host }} {} block.
Essentially I'm trying to get the upstream to look like this:
And so it all makes sense, I have our locations hardcoded which works because the proxy pass is the same as Env.DOCKER_CONTAINER
Thanks in advance.
Docker version 1.6.0, build bdbc177
The text was updated successfully, but these errors were encountered: