From b0de80d46b63f353a198e2110aa2b03ad26e691d Mon Sep 17 00:00:00 2001 From: Steve Kamerman Date: Mon, 3 Oct 2016 10:21:31 -0400 Subject: [PATCH] Moved config edits from Dockerfile to template --- Dockerfile | 5 ++--- nginx.tmpl | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0eb78d6..0a1df5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,10 +9,9 @@ RUN apt-get update \ && apt-get clean \ && rm -r /var/lib/apt/lists/* -# Generate dhparam.pem, configure Nginx, apply fix for very long server names +# Generate dhparam.pem, configure nginx RUN openssl dhparam -out /etc/nginx/dhparam.pem 2048 \ - && echo "daemon off;" >> /etc/nginx/nginx.conf \ - && sed -i 's|^http {|&\n server_names_hash_bucket_size 128;\n ssl_dhparam /etc/nginx/dhparam.pem;|g' /etc/nginx/nginx.conf + && echo "daemon off;" >> /etc/nginx/nginx.conf # Install Forego ADD https://github.com/jwilder/forego/releases/download/v0.16.1/forego /usr/local/bin/forego diff --git a/nginx.tmpl b/nginx.tmpl index b6629f5..779d217 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -31,6 +31,12 @@ map $http_upgrade $proxy_connection { '' close; } +# Apply fix for very long server names +server_names_hash_bucket_size 128; + +# Default dhparam +ssl_dhparam /etc/nginx/dhparam.pem; + gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; log_format vhost '$host $remote_addr - $remote_user [$time_local] '