Guillermo Espinoza 7 years ago
parent
commit
24730b7108

+ 16 - 0
extra/nginx/Dockerfile

@@ -0,0 +1,16 @@
+FROM nginx:1.13
+
+ENV DEBIAN_FRONTEND noninteractive
+
+RUN echo Acquire::http::Proxy "http://aptcache.infra.flowdat.com/"; > /etc/apt/apt.conf.d/00aptproxy
+
+ADD nginx-config.sh /usr/bin/
+RUN chmod +x /usr/bin/nginx-config.sh
+COPY conf.d /etc/nginx/conf.d
+
+RUN rm /etc/nginx/conf.d/*.conf
+
+
+CMD ["/usr/bin/nginx-config.sh"]
+
+RUN rm /etc/apt/apt.conf.d/00aptproxy

+ 12 - 0
extra/nginx/conf.d/base.conf.tpl

@@ -0,0 +1,12 @@
+server {
+    listen 80;
+    listen [::]:80;
+
+    server_name $HOST_BASE;
+
+    location / {
+            proxy_pass http://base:80;
+            proxy_set_header  X-Real-IP  ${DOLAR}remote_addr;
+            proxy_set_header  Host  ${DOLAR}http_host;
+    }
+}

+ 12 - 0
extra/nginx/conf.d/ftth.conf.tpl

@@ -0,0 +1,12 @@
+server {
+    listen 80;
+    listen [::]:80;
+
+    server_name $HOST_FTTH;
+
+    location / {
+            proxy_pass http://ftth:8000;
+            proxy_set_header  X-Real-IP  ${DOLAR}remote_addr;
+            proxy_set_header  Host  ${DOLAR}http_host;
+    }
+}

+ 12 - 0
extra/nginx/conf.d/mapas.conf.tpl

@@ -0,0 +1,12 @@
+server {
+    listen 80;
+    listen [::]:80;
+
+    server_name $HOST_MAPAS;
+
+    location / {
+            proxy_pass http://mapas:8000;
+            proxy_set_header  X-Real-IP  ${DOLAR}remote_addr;
+            proxy_set_header  Host  ${DOLAR}http_host;
+    }
+}

+ 12 - 0
extra/nginx/conf.d/stats.conf.tpl

@@ -0,0 +1,12 @@
+server {
+    listen 80;
+    listen [::]:80;
+
+    server_name $HOST_STATS;
+
+    location / {
+            proxy_pass http://stats:8000;
+            proxy_set_header  X-Real-IP  ${DOLAR}remote_addr;
+            proxy_set_header  Host  ${DOLAR}http_host;
+    }
+}

+ 10 - 0
extra/nginx/nginx-config.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+export DOLAR='$'
+for fn in `ls /etc/nginx/conf.d/*.conf.tpl`; do
+    echo $fn " -> " ${fn:0:(-4)}
+    envsubst < $fn > ${fn:0:(-4)}
+    cat ${fn:0:(-4)}
+done
+
+
+nginx -g "daemon off;"