Skip to content

Commit

Permalink
Merge pull request #265 from boostcampwm-2024/chore/be/#242-devNginxF…
Browse files Browse the repository at this point in the history
…or4th

[BE][Chore] #242 : 4주차 배포를 위한 nginx 세팅
  • Loading branch information
happyhyep authored Nov 26, 2024
2 parents 026cb4d + 5176c31 commit f0a2f0d
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}
}

0 comments on commit f0a2f0d

Please sign in to comment.