Skip to content

Commit

Permalink
cd(nginx): nginx 설정 파일에 ssl 설정 추가
Browse files Browse the repository at this point in the history
- http, https 디렉티브 분리
- certbot 인증서 설정 추가
  • Loading branch information
nyj001012 committed Mar 3, 2024
1 parent 066d868 commit 27abb0c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down Expand Up @@ -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
}

0 comments on commit 27abb0c

Please sign in to comment.