From 6a38c8f9632a5d51df7b82d686990de677ec265c Mon Sep 17 00:00:00 2001 From: hseong3243 Date: Wed, 17 Jan 2024 20:45:17 +0900 Subject: [PATCH 1/4] =?UTF-8?q?test:=20=EB=B0=B0=ED=8F=AC=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=EB=A5=BC=20=EC=9C=84=ED=95=9C=20CD=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CD.yml | 2 +- scripts/data/nginx/backend.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 2b04eae..b9ae16f 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -2,7 +2,7 @@ name: CD on: push: - branches: [ "main" ] + branches: [ "main", "chore/#1-apply-https" ] pull_request: branches: [ "main" ] diff --git a/scripts/data/nginx/backend.conf b/scripts/data/nginx/backend.conf index 78f5d69..a52a43d 100644 --- a/scripts/data/nginx/backend.conf +++ b/scripts/data/nginx/backend.conf @@ -1,6 +1,6 @@ server { listen 80; - server_name _; + server_name shoutlink.me; access_log logs/backend/access.log main; root /usr/share/nginx/html; From b885996a3b67210e9b14bee0efafc69a7ca9fc66 Mon Sep 17 00:00:00 2001 From: hseong3243 Date: Wed, 17 Jan 2024 23:06:01 +0900 Subject: [PATCH 2/4] =?UTF-8?q?chore:=20=EB=8F=84=EC=BB=A4=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EC=A6=88=20nginx=20ssl=20=EB=94=94=EB=A0=89=ED=86=A0?= =?UTF-8?q?=EB=A6=AC=20=EB=B0=94=EC=9D=B8=EB=93=9C=20=EB=A7=88=EC=9A=B4?= =?UTF-8?q?=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/docker-compose.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/docker-compose.yml b/scripts/docker-compose.yml index 24a5775..b12eed9 100644 --- a/scripts/docker-compose.yml +++ b/scripts/docker-compose.yml @@ -6,6 +6,7 @@ services: image: nginx ports: - "80:80" + - "443:443" networks: - shoutlink environment: @@ -13,6 +14,7 @@ services: volumes: - ./data/nginx:/etc/nginx/conf.d - ./data/nginx/logs:/etc/nginx/logs + - /home/ubuntu/data/ssl/etc/letsencrypt:/etc/letsencrypt shoutlink: image: hseong3243/shoutlink @@ -26,4 +28,4 @@ services: - ./data/logs:/logs networks: - shoutlink: \ No newline at end of file + shoutlink: From 7e32b0f7505d6b40ecc3c505f42275156da8c9bb Mon Sep 17 00:00:00 2001 From: hseong3243 Date: Wed, 17 Jan 2024 23:06:22 +0900 Subject: [PATCH 3/4] =?UTF-8?q?chore:=20nginx=20ssl=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/data/nginx/backend.conf | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/scripts/data/nginx/backend.conf b/scripts/data/nginx/backend.conf index a52a43d..16b2a1d 100644 --- a/scripts/data/nginx/backend.conf +++ b/scripts/data/nginx/backend.conf @@ -1,12 +1,27 @@ server { listen 80; server_name shoutlink.me; - access_log logs/backend/access.log main; - root /usr/share/nginx/html; - location /api { - proxy_pass http://backend; + location / { + return 301 https://$server_name$request_uri; } + +# location /.well-known/acme-challenge/ { +# root /var/www/certbot; +# } +} + +server { + listen 443 ssl; + server_name shoutlink.me; + + location / { + proxy_pass http://backend; + } + + ssl_certificate /etc/letsencrypt/live/shoutlink.me/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/shoutlink.me/privkey.pem; + ssl_prefer_server_ciphers on; } upstream backend { From 04c5914cd3139ac696a534c9cb70131983dd9478 Mon Sep 17 00:00:00 2001 From: hseong3243 Date: Wed, 17 Jan 2024 23:10:09 +0900 Subject: [PATCH 4/4] =?UTF-8?q?test:=20ssl=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=99=84=EB=A3=8C=EB=A1=9C=20=EC=9D=B8=ED=95=B4=20CD=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CD.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index b9ae16f..560be57 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -2,8 +2,6 @@ name: CD on: push: - branches: [ "main", "chore/#1-apply-https" ] - pull_request: branches: [ "main" ] permissions: