File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments