2025-12-29 20:01:55 +03:00
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
server_name localhost;
|
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
|
index index.html;
|
|
|
|
|
|
|
|
|
|
# Gzip compression
|
|
|
|
|
gzip on;
|
|
|
|
|
gzip_vary on;
|
|
|
|
|
gzip_min_length 1024;
|
|
|
|
|
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml+rss application/json;
|
|
|
|
|
|
|
|
|
|
# Proxy API requests to backend (localhost внутри контейнера)
|
|
|
|
|
location /api/ {
|
|
|
|
|
proxy_pass http://localhost:8080;
|
|
|
|
|
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_cache_bypass $http_upgrade;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Proxy webhook endpoints to backend
|
|
|
|
|
location /webhook/ {
|
|
|
|
|
proxy_pass http://localhost:8080;
|
|
|
|
|
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_cache_bypass $http_upgrade;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Proxy daily-report endpoints to backend
|
|
|
|
|
location /daily-report/ {
|
|
|
|
|
proxy_pass http://localhost:8080;
|
|
|
|
|
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_cache_bypass $http_upgrade;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Proxy other API endpoints to backend
|
2026-01-02 16:11:35 +03:00
|
|
|
location ~ ^/(playlife-feed|d2dc349a-0d13-49b2-a8f0-1ab094bfba9b|projects|project/priority|project/move|project/delete|project/create|message/post|weekly_goals/setup|admin|admin\.html)$ {
|
2025-12-29 20:01:55 +03:00
|
|
|
proxy_pass http://localhost:8080;
|
|
|
|
|
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_cache_bypass $http_upgrade;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-10 21:46:54 +03:00
|
|
|
# Service Worker должен быть без кэширования
|
|
|
|
|
location /sw.js {
|
|
|
|
|
add_header Cache-Control "no-cache";
|
|
|
|
|
expires 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Manifest тоже без долгого кэширования
|
|
|
|
|
location /manifest.webmanifest {
|
|
|
|
|
add_header Cache-Control "no-cache";
|
|
|
|
|
expires 0;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-11 21:12:26 +03:00
|
|
|
# Раздача загруженных файлов (картинки wishlist) - проксируем через backend
|
|
|
|
|
# Используем ^~ чтобы этот location имел приоритет над regex locations
|
|
|
|
|
location ^~ /uploads/ {
|
|
|
|
|
proxy_pass http://localhost:8080;
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
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;
|
|
|
|
|
expires 30d;
|
|
|
|
|
add_header Cache-Control "public, immutable";
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-29 20:01:55 +03:00
|
|
|
# Handle React Router (SPA)
|
|
|
|
|
location / {
|
|
|
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Cache static assets
|
|
|
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
|
|
|
|
expires 1y;
|
|
|
|
|
add_header Cache-Control "public, immutable";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|