From e11a4a8f3661077bb31f1901000239d7d339ccec Mon Sep 17 00:00:00 2001 From: bachhungcb Date: Fri, 3 Apr 2026 10:57:47 +0700 Subject: [PATCH 1/2] update docker file for https compability --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5dcae0a..c037fa0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,6 @@ COPY --from=development /app/dist /usr/share/nginx/html COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf -EXPOSE 80 +EXPOSE 80 443 ENTRYPOINT [ "nginx", "-g", "daemon off;" ] \ No newline at end of file From 95766806f9f6decd5a0be7bb5a8559705a8b3df0 Mon Sep 17 00:00:00 2001 From: bachhungcb Date: Fri, 3 Apr 2026 10:58:17 +0700 Subject: [PATCH 2/2] update nginx config for https compability --- nginx/nginx.conf | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 7f4d6aa..4d5081d 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -5,12 +5,22 @@ # } server { listen 80; + return 301 https://$host$request_uri; # Redirect HTTP sang HTTPS + +} + +server{ + listen 443 ssl; + server_name comp.soict.io; + ssl_certificate /etc/nginx/ssl/nginx-selfsigned.crt; + ssl_certificate_key /etc/nginx/ssl/nginx-selfsigned.key; + set $backend_server 172.18.10.8:8080; - + root /usr/share/nginx/html; # Default file to serve for directory requests index index.html index.htm; - + location / { # Try to serve the requested file directly ($uri) # If it's a directory, try serving the index file ($uri/) @@ -68,4 +78,4 @@ server { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } -} +} \ No newline at end of file