Spaces:
Running
Running
Upload 2 files
Browse files- client/nginx.conf +36 -63
client/nginx.conf
CHANGED
|
@@ -1,69 +1,42 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
'"$http_user_agent" "$http_x_forwarded_for"';
|
| 13 |
-
|
| 14 |
-
access_log /var/log/nginx/access.log main;
|
| 15 |
-
error_log /var/log/nginx/error.log;
|
| 16 |
-
|
| 17 |
-
sendfile on;
|
| 18 |
-
tcp_nopush on;
|
| 19 |
-
tcp_nodelay on;
|
| 20 |
-
keepalive_timeout 65;
|
| 21 |
-
types_hash_max_size 2048;
|
| 22 |
-
|
| 23 |
-
# Include MIME types
|
| 24 |
-
include /etc/nginx/mime.types;
|
| 25 |
-
default_type application/octet-stream;
|
| 26 |
-
|
| 27 |
-
# Server block
|
| 28 |
-
server {
|
| 29 |
-
listen 80;
|
| 30 |
-
server_name localhost;
|
| 31 |
-
|
| 32 |
-
# Serve static files
|
| 33 |
-
location / {
|
| 34 |
-
root /usr/share/nginx/html;
|
| 35 |
-
index index.html index.htm;
|
| 36 |
-
try_files $uri $uri/ /index.html;
|
| 37 |
-
}
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
}
|
| 68 |
}
|
| 69 |
}
|
|
|
|
| 1 |
+
# Server block
|
| 2 |
+
server {
|
| 3 |
+
listen 80;
|
| 4 |
+
server_name localhost;
|
| 5 |
+
|
| 6 |
+
# Serve static files
|
| 7 |
+
location / {
|
| 8 |
+
root /usr/share/nginx/html;
|
| 9 |
+
index index.html index.htm;
|
| 10 |
+
try_files $uri $uri/ /index.html;
|
| 11 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
+
# Proxy API requests to the backend (same container)
|
| 14 |
+
location /api/ {
|
| 15 |
+
proxy_pass http://localhost:3001;
|
| 16 |
+
proxy_http_version 1.1;
|
| 17 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 18 |
+
proxy_set_header Connection 'upgrade';
|
| 19 |
+
proxy_set_header Host $host;
|
| 20 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 21 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 22 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 23 |
+
proxy_cache_bypass $http_upgrade;
|
| 24 |
+
}
|
| 25 |
|
| 26 |
+
# Health check endpoint
|
| 27 |
+
location /health {
|
| 28 |
+
access_log off;
|
| 29 |
+
return 200 "healthy\n";
|
| 30 |
+
add_header Content-Type text/plain;
|
| 31 |
+
}
|
| 32 |
|
| 33 |
+
error_page 404 /404.html;
|
| 34 |
+
location = /404.html {
|
| 35 |
+
internal;
|
| 36 |
+
}
|
| 37 |
|
| 38 |
+
error_page 500 502 503 504 /50x.html;
|
| 39 |
+
location = /50x.html {
|
| 40 |
+
root /usr/share/nginx/html;
|
|
|
|
| 41 |
}
|
| 42 |
}
|