Create nginx.conf
Browse files- nginx.conf +24 -0
nginx.conf
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
server {
|
2 |
+
listen 80;
|
3 |
+
|
4 |
+
# Serve the index.html file
|
5 |
+
location / {
|
6 |
+
root /app; # Root directory where your frontend files (index.html) are located
|
7 |
+
index index.html;
|
8 |
+
}
|
9 |
+
|
10 |
+
# Proxy WebSocket requests
|
11 |
+
location /ws/ {
|
12 |
+
proxy_pass http://localhost:6060; # WebSocket backend
|
13 |
+
proxy_http_version 1.1;
|
14 |
+
proxy_set_header Upgrade $http_upgrade;
|
15 |
+
proxy_set_header Connection "Upgrade";
|
16 |
+
proxy_set_header Host $host;
|
17 |
+
}
|
18 |
+
|
19 |
+
# Optional: Set cache headers for static files
|
20 |
+
location /static/ {
|
21 |
+
root /app;
|
22 |
+
expires 30d;
|
23 |
+
}
|
24 |
+
}
|