From c5492c8fbaf303bb71b28a4fe0cfe1cdbbfe9592 Mon Sep 17 00:00:00 2001 From: Maxim Samsonov Date: Thu, 18 Jul 2024 20:54:24 +0300 Subject: [PATCH] feat: SSL for web node docker container --- dkgServiceNode/Data/DbEnsure.cs | 3 +-- dkgWebNode/Dockerfile | 2 +- dkgWebNode/config/nginx.docker.config | 19 +++++++++++++------ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/dkgServiceNode/Data/DbEnsure.cs b/dkgServiceNode/Data/DbEnsure.cs index 213dbf8..a524b96 100644 --- a/dkgServiceNode/Data/DbEnsure.cs +++ b/dkgServiceNode/Data/DbEnsure.cs @@ -210,11 +210,10 @@ public static void Ensure(string connectionString) } Ensure_0_8_0(connection); - PuVersionUpdate("0.8.1", connection); - PuVersionUpdate("0.8.2", connection); PuVersionUpdate("0.9.1", connection); PuVersionUpdate("0.9.2", connection); PuVersionUpdate("0.9.3", connection); + PuVersionUpdate("0.9.4", connection); } } diff --git a/dkgWebNode/Dockerfile b/dkgWebNode/Dockerfile index 02773f9..3fe534a 100644 --- a/dkgWebNode/Dockerfile +++ b/dkgWebNode/Dockerfile @@ -22,6 +22,6 @@ COPY dkgWebNode/config/nginx.docker.config /etc/nginx/conf.d/default.conf # Expose port 80 for HTTP EXPOSE 80 -#EXPOSE 443 +EXPOSE 443 # Start Nginx and keep it running in the foreground CMD ["nginx", "-g", "daemon off;"] diff --git a/dkgWebNode/config/nginx.docker.config b/dkgWebNode/config/nginx.docker.config index 02a48c1..69a33f5 100644 --- a/dkgWebNode/config/nginx.docker.config +++ b/dkgWebNode/config/nginx.docker.config @@ -1,13 +1,20 @@ +server { + listen 80; + listen [::]:80; + server_name _ ; + +# Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. + return 301 https://$server_name$request_uri; +} + server { include mime.types; default_type application/octet-stream; - listen 80 ; - listen [::]:80 ; - # listen 443 ssl ; - # listen [::]:443 ssl ; - # ssl_certificate /etc/nginx/certificate/s.crt; - # ssl_certificate_key /etc/nginx/certificate/s.key; + listen 443 ssl ; + listen [::]:443 ssl ; + ssl_certificate /etc/nginx/certificate/s.crt; + ssl_certificate_key /etc/nginx/certificate/s.key; root /var/www/dkg; index index.html;