(Boosts appreciated)Ok, I've seen some stuff that makes me question whether you can use a natively installed (so non-containerized) nginx to reverse proxy to docker apps?
-
(Boosts appreciated)
Ok, I've seen some stuff that makes me question whether you can use a natively installed (so non-containerized) nginx to reverse proxy to docker apps? I've seen some people say you need to use nginx under docker for that but I don't understand why that would be the case. Can anyone clarify if this is possible or why if it isn't?
I've also seen stuff about docker-gen and nginx-proxy-manager I still have to look at. -
R relay@relay.mycrowd.ca shared this topic
-
(Boosts appreciated)
Ok, I've seen some stuff that makes me question whether you can use a natively installed (so non-containerized) nginx to reverse proxy to docker apps? I've seen some people say you need to use nginx under docker for that but I don't understand why that would be the case. Can anyone clarify if this is possible or why if it isn't?
I've also seen stuff about docker-gen and nginx-proxy-manager I still have to look at.@mothwaves I can't think of any reason why nginx would need to be containerized. the network setup may look different (if you aren't using host networking in docker), but it should just work
-
@mothwaves I can't think of any reason why nginx would need to be containerized. the network setup may look different (if you aren't using host networking in docker), but it should just work
@monoidmusician Ok that's good to hear. Frankly all the information about nginx and my lack or knowledge in a lot of the spaces is making my head spin
so im just glad to hear at least that it should be possible.
-
@monoidmusician Ok that's good to hear. Frankly all the information about nginx and my lack or knowledge in a lot of the spaces is making my head spin
so im just glad to hear at least that it should be possible.@mothwaves yeah, i understand, i’ve had to go through it too
-
@mothwaves yeah, i understand, i’ve had to go through it too
@mothwaves any URL that you can access locally on the server (outside of docker), nginx will be able to reverse proxy, since that’s basically what it does, just send the requests on.
so if you can see the URL with curl or with a browser, it should be fine.
the only real complication there is docker networking, where you need to explicitly list ports to expose and i think you might need to use a hostname other than localhost, but i’ve mostly used host networking (just make sure your firewall is set up to block incoming connections to the port, just allow nginx to access it locally)
-
(Boosts appreciated)
Ok, I've seen some stuff that makes me question whether you can use a natively installed (so non-containerized) nginx to reverse proxy to docker apps? I've seen some people say you need to use nginx under docker for that but I don't understand why that would be the case. Can anyone clarify if this is possible or why if it isn't?
I've also seen stuff about docker-gen and nginx-proxy-manager I still have to look at.@mothwaves No reason this wouldn't work. It's a standard setup, you just setup nginx to reverse proxy from some domain to localhost port whatever. Then your docker containers should always bind to localhost for security reasons. Then finally configure nginx to proxy from your external interface to the localhost port, and you can slap TLS certs or whatever on top.
I am lazy so I just use Caddy for this, easier to config.
-
@mothwaves No reason this wouldn't work. It's a standard setup, you just setup nginx to reverse proxy from some domain to localhost port whatever. Then your docker containers should always bind to localhost for security reasons. Then finally configure nginx to proxy from your external interface to the localhost port, and you can slap TLS certs or whatever on top.
I am lazy so I just use Caddy for this, easier to config.
@fd93 Yeah, this is what I was trying to do but I must be missing/misunderstanding something about the networking. I'm not currently working with it but I'll give an update when I do work on it again. -
@mothwaves any URL that you can access locally on the server (outside of docker), nginx will be able to reverse proxy, since that’s basically what it does, just send the requests on.
so if you can see the URL with curl or with a browser, it should be fine.
the only real complication there is docker networking, where you need to explicitly list ports to expose and i think you might need to use a hostname other than localhost, but i’ve mostly used host networking (just make sure your firewall is set up to block incoming connections to the port, just allow nginx to access it locally)
@monoidmusician I'm probably overlooking something with the docker networking. I'll try looking into it further.