diff --git a/Dockerfile b/Dockerfile index 1319579..37b7d9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -65,7 +65,7 @@ RUN echo "daemon off;" >> /etc/nginx/nginx.conf \ COPY --from=forego /usr/local/bin/forego /usr/local/bin/forego COPY --from=dockergen /usr/local/bin/docker-gen /usr/local/bin/docker-gen -COPY network_internal.conf /etc/nginx/ +COPY network_internal.conf /etc/nginx/networks/internal.conf COPY app nginx.tmpl LICENSE /app/ WORKDIR /app/ diff --git a/nginx.tmpl b/nginx.tmpl index e7d77c9..32df2c0 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -53,9 +53,9 @@ {{ define "location" }} location {{ .Path }} { - {{ if eq .NetworkTag "internal" }} - # Only allow traffic from internal clients - include /etc/nginx/network_internal.conf; + {{ if ne .NetworkTag "external" }} + # Allow traffic according of the given network config + include {{ (printf "/etc/nginx/networks/%s.conf" .NetworkTag) }}; {{ end }} {{ if eq .Proto "uwsgi" }}