docker-gen icon indicating copy to clipboard operation
docker-gen copied to clipboard

Allow only internal networks

Open kaosmonk opened this issue 7 years ago • 5 comments

Hello,

I'd like to have some containers exposed only to internal networks as explained in jwilder/nginx-proxy docs but since I am using separate containers in my setup - official nginx and docker-gen images - I'm not sure how to do exactly the same. Should I edit the nginx.tmpl or am I missing some existing options?

Thanks!

kaosmonk avatar Oct 29 '17 18:10 kaosmonk

@kaosmonk as I understand, it is already done. I use almost official nginx.tmpl (with one important fix for many networks) and official nginx and docker-gen docker images. My APIs inside one virtual network with nginx, but it is internal docker network.

tomfun avatar Feb 07 '18 17:02 tomfun

@kaosmonk just noticed this open issue. To make NETWORK_ACCESS=internal on docker-gen do the following:

Manually mount network_internal.conf in /etc/nginx/network_internal.conf and use the nginx-proxy from https://github.com/jwilder/nginx-proxy

I have opened https://github.com/jwilder/docker-gen/issues/278 to see if some good soul can fix the Dockerfile

returntrip avatar Mar 02 '18 17:03 returntrip

Thanks a lot!

kaosmonk avatar Mar 03 '18 21:03 kaosmonk

Jus for the records, with official nginx image it works as expected, mounting:

-v /path/to/network_internal.conf:/etc/nginx/network_internal.conf

I tested it with 3 containers (official nginx, nginx-gen and nginx-letsencryptcompanion)

jlegido avatar Jul 05 '19 13:07 jlegido

I had a similar use case: I needed to proxy containers which are only connected to an internal network (to deny egress traffic), therefore they cannot expose ports and require some template configuration to be proxiable. I described the issue and my solution in the google group: https://groups.google.com/forum/#!topic/nginx-proxy/YL5GypqStOA

hacker-h avatar Jun 09 '20 00:06 hacker-h

This repo should no longer handle issues or discussions related to nginx-proxy / the nginx-proxy template, unless there is something we need to change / fix in docker-gen in order to allow a change / fix in nginx-proxy.

buchdag avatar May 16 '24 12:05 buchdag