From b3d961a3dc07a7aa6e5946dd300cd5ddddef612c Mon Sep 17 00:00:00 2001 From: Dmytro Makovey Date: Thu, 21 Sep 2017 23:56:15 -0700 Subject: [PATCH] adding nginx modularity --- nginx/Dockerfile | 2 ++ nginx/extra.d/.keep | 0 nginx/http.d/.keep | 0 nginx/nginx.conf.default | 3 +++ nginx/nginx.conf.fallback | 4 ++++ 5 files changed, 9 insertions(+) create mode 100644 nginx/extra.d/.keep create mode 100644 nginx/http.d/.keep diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 15d00972..2a8308f9 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -4,6 +4,8 @@ RUN apk add --no-cache nginx-mod-http-lua openssl COPY nginx.conf.default /etc/nginx/nginx.conf.default COPY nginx.conf.fallback /etc/nginx/nginx.conf.fallback +COPY http.d /etc/nginx/ +COPY extra.d /etc/nginx/ COPY start.sh /start.sh diff --git a/nginx/extra.d/.keep b/nginx/extra.d/.keep new file mode 100644 index 00000000..e69de29b diff --git a/nginx/http.d/.keep b/nginx/http.d/.keep new file mode 100644 index 00000000..e69de29b diff --git a/nginx/nginx.conf.default b/nginx/nginx.conf.default index 2dd4729c..87982712 100644 --- a/nginx/nginx.conf.default +++ b/nginx/nginx.conf.default @@ -50,6 +50,7 @@ http { set_by_lua $webdav 'return os.getenv("WEBDAV")'; set_by_lua $expose_admin 'return os.getenv("EXPOSE_ADMIN")'; + include http.d/*.conf; # Actual logic location / { @@ -97,3 +98,5 @@ http { } } } + +include extra.d/*.conf; diff --git a/nginx/nginx.conf.fallback b/nginx/nginx.conf.fallback index 985c6189..50bb77cb 100644 --- a/nginx/nginx.conf.fallback +++ b/nginx/nginx.conf.fallback @@ -36,6 +36,8 @@ http { add_header Strict-Transport-Security max-age=15768000; + include http.d/*.conf; + if ($scheme = http) { return 301 https://$host$request_uri; } @@ -45,3 +47,5 @@ http { } } } + +include extra.d/*.conf;