From 5dc80ae64f6766023a9b61c212bd3c58c1ccf998 Mon Sep 17 00:00:00 2001 From: Rubin Gjerovski Date: Tue, 6 Sep 2016 19:10:04 +0200 Subject: [PATCH] added default nginx configuration file --- Dockerfile | 5 ++--- nginx.conf | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index 6d5ce9b..ad21895 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,9 +9,8 @@ RUN apt-get update \ && apt-get clean \ && rm -r /var/lib/apt/lists/* -# Configure Nginx and apply fix for very long server names -RUN echo "daemon off;" >> /etc/nginx/nginx.conf \ - && sed -i 's/^http {/&\n server_names_hash_bucket_size 128;/g' /etc/nginx/nginx.conf +# Copy nginx configuration file +COPY nginx.conf /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.conf b/nginx.conf new file mode 100644 index 0000000..533eb7c --- /dev/null +++ b/nginx.conf @@ -0,0 +1,33 @@ +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + server_names_hash_bucket_size 128; + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; +} +daemon off;