Skip to content

Commit a2e5208

Browse files
committed
feat: nginx 설정 파일 작성
1 parent c0105f0 commit a2e5208

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

services/nginx/conf.d/default.conf

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
server {
2+
listen 80;
3+
server_name localhost octodocs.local;
4+
return 301 https://$host$request_uri;
5+
}
6+
7+
server {
8+
listen 443 ssl;
9+
server_name localhost octodocs.local;
10+
11+
ssl_certificate /etc/nginx/ssl/localhost.crt;
12+
ssl_certificate_key /etc/nginx/ssl/localhost.key;
13+
14+
# Frontend static files
15+
location / {
16+
root /usr/share/nginx/html;
17+
try_files $uri $uri/ /index.html;
18+
add_header Cache-Control "no-cache";
19+
}
20+
21+
# Backend API
22+
location /api {
23+
proxy_pass http://backend:3000;
24+
proxy_http_version 1.1;
25+
proxy_set_header Upgrade $http_upgrade;
26+
proxy_set_header Connection 'upgrade';
27+
proxy_set_header Host $host;
28+
proxy_cache_bypass $http_upgrade;
29+
}
30+
31+
# WebSocket
32+
location /socket.io {
33+
proxy_pass http://backend:1234;
34+
proxy_http_version 1.1;
35+
proxy_set_header Upgrade $http_upgrade;
36+
proxy_set_header Connection "Upgrade";
37+
proxy_set_header Host $host;
38+
}
39+
}

0 commit comments

Comments
 (0)