Skip to content

Commit

Permalink
chore: ssl 인증서를 발급하고 https를 적용한다.
Browse files Browse the repository at this point in the history
chore: ssl 인증서를 발급하고 https를 적용한다.
  • Loading branch information
hseong3243 authored Jan 17, 2024
2 parents 1affd42 + 04c5914 commit 9497f09
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: CD
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read
Expand Down
25 changes: 20 additions & 5 deletions scripts/data/nginx/backend.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
server {
listen 80;
server_name _;
access_log logs/backend/access.log main;
root /usr/share/nginx/html;
server_name shoutlink.me;

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 {
Expand Down
4 changes: 3 additions & 1 deletion scripts/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ services:
image: nginx
ports:
- "80:80"
- "443:443"
networks:
- shoutlink
environment:
TZ: "Asia/Seoul"
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
Expand All @@ -26,4 +28,4 @@ services:
- ./data/logs:/logs

networks:
shoutlink:
shoutlink:

0 comments on commit 9497f09

Please sign in to comment.