From ad00aa25e9444a1834291fb514a24444ee100018 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sat, 2 Apr 2022 00:54:34 +1100 Subject: [PATCH] Updated nginx.conf so we can extend it --- Dockerfile | 7 +------ etc/nginx/nginx.conf | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 etc/nginx/nginx.conf diff --git a/Dockerfile b/Dockerfile index d02ab15..8c8caa9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM nginx:latest COPY etc/nginx/default.d /etc/nginx/default.d +COPY etc/nginx/nginx.conf /etc/nginx COPY var/www/maintenance /var/www/maintenance RUN chmod 444 /etc/nginx/default.d/ssl/* && chmod 400 /etc/nginx/default.d/ssl/default.key /etc/nginx/default.d/ssl/dhparams.pem @@ -16,12 +17,6 @@ RUN apt-get update && apt-get install python3-certbot-dns-cloudflare -yy \ # Add acme-lego Certbot RUN curl -sL https://github.com/go-acme/lego/releases/download/v4.2.0/lego_v4.2.0_linux_amd64.tar.gz | tar -C /usr/local/sbin -xzf - -#RUN cd /usr/local/sbin && \ -# curl -O https://dl.eff.org/certbot-auto && \ -# chmod +x certbot-auto && ./certbot-auto -n --install-only -# -#RUN ln -s /usr/local/sbin/certbot-auto /usr/local/sbin/certbot - EXPOSE 80 443 COPY ssl.sh /usr/local/sbin/ diff --git a/etc/nginx/nginx.conf b/etc/nginx/nginx.conf new file mode 100644 index 0000000..201a4fe --- /dev/null +++ b/etc/nginx/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; + multi_accept on; +} + +http { + 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; +} + +include /etc/nginx/include.d/*.conf;