From 5300b5b2504f3280e527a05f672b8390c1bc1c49 Mon Sep 17 00:00:00 2001 From: yena <50291995+nyj001012@users.noreply.github.com> Date: Sun, 3 Mar 2024 14:28:15 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat(nginx):=20nginx=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=20=ED=8C=8C=EC=9D=BC=EC=97=90=20ssl=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - http, https 디렉티브 분리 - certbot 인증서 설정 추가 --- nginx/conf.d/default.conf | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf index ed487f38..d655e4e2 100644 --- a/nginx/conf.d/default.conf +++ b/nginx/conf.d/default.conf @@ -1,9 +1,15 @@ server { - listen 80; + listen 443 ssl; server_name 42library.kr; #access_log /var/log/nginx/host.access.log main; + ssl_certificate /etc/letsencrypt/live/42library.kr/fullchain.pem; # managed by Cert> + ssl_certificate_key /etc/letsencrypt/live/42library.kr/privkey.pem; # managed by Ce> + + include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot + location /api/ { proxy_pass http://backend:3000; } @@ -42,3 +48,13 @@ server { root /usr/share/nginx/html; } } + +server { + if ($host = idu-market.shop) { + return 301 https://$host$request_uri; + } # managed by Certbot + + listen 80; + server_name 42library.kr; + return 404; # managed by Certbot +} From 85987198363a05f7bde3f4da54251c7de8838fd4 Mon Sep 17 00:00:00 2001 From: yena <50291995+nyj001012@users.noreply.github.com> Date: Sat, 27 Apr 2024 13:11:47 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20host=20=EB=B9=84=EA=B5=90=20?= =?UTF-8?q?=EC=A1=B0=EA=B1=B4=EB=AC=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx/conf.d/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf index d655e4e2..7aa1a7c2 100644 --- a/nginx/conf.d/default.conf +++ b/nginx/conf.d/default.conf @@ -50,7 +50,7 @@ server { } server { - if ($host = idu-market.shop) { + if ($host = 42library.kr) { return 301 https://$host$request_uri; } # managed by Certbot