2025-12-12 13:30:09 +03:00
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
server_name localhost;
|
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
|
index index.html;
|
|
|
|
|
|
2025-12-12 16:53:56 +03:00
|
|
|
# Max upload size
|
2025-12-12 17:18:54 +03:00
|
|
|
client_max_body_size 30M;
|
2025-12-12 16:53:56 +03:00
|
|
|
|
2025-12-12 13:30:09 +03:00
|
|
|
# Gzip compression
|
|
|
|
|
gzip on;
|
|
|
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
|
|
|
|
|
|
|
|
# API proxy
|
|
|
|
|
location /api {
|
|
|
|
|
proxy_pass http://backend:8000;
|
|
|
|
|
proxy_http_version 1.1;
|
2025-12-12 16:53:56 +03:00
|
|
|
proxy_set_header Host $http_host;
|
2025-12-12 13:30:09 +03:00
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
2025-12-12 16:53:56 +03:00
|
|
|
proxy_set_header Range $http_range;
|
|
|
|
|
proxy_set_header If-Range $http_if_range;
|
|
|
|
|
proxy_redirect off;
|
|
|
|
|
|
|
|
|
|
# Disable buffering for streaming
|
|
|
|
|
proxy_buffering off;
|
|
|
|
|
proxy_cache off;
|
|
|
|
|
proxy_request_buffering off;
|
2025-12-12 13:30:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# WebSocket proxy
|
|
|
|
|
location /ws {
|
|
|
|
|
proxy_pass http://backend:8000;
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
|
proxy_read_timeout 86400;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# SPA routing
|
|
|
|
|
location / {
|
|
|
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
|
}
|
|
|
|
|
}
|