From 5176c31bd9922b3c39e31a13e5aabb3dccc952b8 Mon Sep 17 00:00:00 2001 From: Hyein Jeong Date: Tue, 26 Nov 2024 13:19:44 +0900 Subject: [PATCH] =?UTF-8?q?[BE][Chore]=20#242=20:=204=EC=A3=BC=EC=B0=A8=20?= =?UTF-8?q?=EB=B0=B0=ED=8F=AC=EB=A5=BC=20=EC=9C=84=ED=95=9C=20nginx=20?= =?UTF-8?q?=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 4주차 배포를 위한 nginx 세팅 (dev 브랜치와 동일) --- nginx.conf | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/nginx.conf b/nginx.conf index 09cc6772..a7eccb1e 100644 --- a/nginx.conf +++ b/nginx.conf @@ -10,6 +10,19 @@ http { server { listen 80; + server_name ddara.kro.kr; + + return 301 https://$host$request_uri; + } + + server { + listen 443 ssl; + server_name ddara.kro.kr; + + ssl_certificate /etc/letsencrypt/live/ddara.kro.kr/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/ddara.kro.kr/privkey.pem; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; location /api/ { proxy_pass http://backend:3001; @@ -18,10 +31,26 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } - # TODO: 프론트엔드 요청 처리 (나중에 활성화) + location /api-docs/ { + proxy_pass http://backend:3001/api-docs/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location /ws/ { + proxy_pass http://backend:3001/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $host; + } + location / { - root /usr/share/nginx/html; - index index.html; + proxy_pass http://frontend:80; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } }