Browse Source

Use host networking for nginx

pull/9/head
Chris Smith 8 years ago
parent
commit
a63ae7c355
1 changed files with 4 additions and 11 deletions
  1. 4
    11
      docker-compose.yml

+ 4
- 11
docker-compose.yml View File

@@ -104,11 +104,9 @@ services:
104 104
       - etcd
105 105
 
106 106
   # Finally, nginx is what actually does the SSL termination and
107
-  # reverse proxying. If any containers to be proxied are on
108
-  # non-default networks, you'll need to specify them here and
109
-  # below in the top-level networks section.
110
-  #
111
-  # TODO: Redirect HTTP and add proper SSL options
107
+  # reverse proxying. Because it needs to connect to containers
108
+  # on (potentially) many different networks, we set the
109
+  # network_mode to host.
112 110
   nginx:
113 111
     image: nginx:1.9
114 112
     container_name: autoproxy_nginx
@@ -118,9 +116,7 @@ services:
118 116
     ports:
119 117
       - 80:80
120 118
       - 443:443
121
-    networks:
122
-      - default
123
-    # - mynetwork
119
+    network_mode: host
124 120
 
125 121
   # We use inotify-signal-container to monitor for nginx config
126 122
   # file and SSL cert changes (using inotify) and send nginx a
@@ -147,6 +143,3 @@ networks:
147 143
 
148 144
   etcd-services:
149 145
 
150
-  # To add pre-existing networks, mark them as 'external':
151
-  #mynetwork:
152
-  #  external: true

Loading…
Cancel
Save