-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Non-Docker Host #1100
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
base: main
Are you sure you want to change the base?
Non-Docker Host #1100
Conversation
I currently need this functionality. Integrating a patch for now. |
|
This works great. I manually patched my template file but this gets overwritten when updated. Is there any way to do this automatically or is this going to be merged into the build? Thank you! |
I commented out the line that automatically pulls the latest template. I think it would be good to provide that url as an ENV variable so that way we can override it with our own. I've got a couple other customizations I've made to it as well. |
This is much needed. Please merge! |
In the meantime, this project does the job. However, I still think this should be a feature of jwilder/nginx-proxy. If it could be so that we don't have to use a dummy container, that would be great (by maybe using an array of domains=>upstreams in an ENV var, or even a file somewhere. Just a thought ;). |
Is there any way to get this merged or a feature like this added? I have set this manually multiple times but it gets overwritten. Thank you! @jwilder |
Please, please, I'm all for merging this one |
Hi @CWempe BTW, if the merge won't be attractive because it seems you needed a dummy-container, you could point out, that any container would do. e.g. I reuse a "python:3-slim" container that I use anyway and added your "command: tail -f /dev/null" to the docker-compose file. This seems to do the job just as well. |
Did this ever get merged? Will it? |
please merge this one? |
Where is this PR currently at? This functionality is super useful and will allow us to just use this one proxy instead of having to maintain this and apache2 |
I am looking forward this feature too. Currently I use a workaround by editing nginx.tmpl to be able to generate my list of upstreams. |
Hey man is it possible you could share an example for your tmpl workaround? Also I doubt jwilder will be doing anything about this. Been waiting on this PR for ages |
It is very ugly lol, but does the job for what I want. Basically I used @CWempe's template and I just added another
I am too lazy to learn how Go templating works. Maybe someone can add a check for UPSTREAM_NAMES if it is defined (similar to what we have now) and loop over it. Separated by space or comma. In bash that would be something like:
|
This PR looks really handy for this situation. But in the absence of it, here's a workaround... create a docker container that forwards the network traffic to your off-docker service host. I've accomplished this work a socat container like this:
nginx-proxy then treats this container as an upstream, which actually sends all network traffic to In the absence of a merge of this PR, or similar functionality, this seemed like a nice 'compatible' way to get everything working without much hacking. |
Tried using the mikesplain/nginx-proxy-pass-docker but when I try to connect to another physical machine on my local network I get "*378 no live upstreams while connecting to upstream", any ideas? |
@gustavogmoraes Are you putting the appropriate port to listen to the physical machine? i.e.
Also I believe you have to use IP addressing to reference the remote machine. Maybe I'm wrong tho...been a while. I use traefik now, which does this painlessly. |
Could the questions about mikesplain/nginx-proxy-pass-docker could be asked on this project repository rather than here ? |
@buchdag sure. Or this PR could have been merged and we wouldn't need to speak about the other project repository 🙂 ... |
@bkraul Both docker-gen and nginx-proxy stated scope was always to generated config file from / proxy to Docker container. While I understand this is a useful and wanted feature, it won't be implemented using zombie containers. |
Hi @buchdag , Yes, if I just wanted the traffic to work, I guess that what @amosipov said: #998 (comment) would suffice. But then I don't have the comfort of automatic certificates... Please reconsider! BTW: The current patch reduces (as far as I can see) to:
|
This PR adds support to generate the config (and certificates) for hosts that are not docker containers.
Useful if you want to proxy to another physical machine.
Just start a dummy container with the new
UPSTREAM_NAME
environment variable, becausenginx-proxy
anddocker-gen
cannot detect the correct server address if it is not a connected container.I tried the local test before I created this PR, but it failed completely. 😞
However I don't think this is because of my changes, since it faild with the master branch, too.