Files
nahodka-front/nginx.conf
SlimusMinus a029254cf0 Tests for auth refresh, ad viewability and URL safety; nginx, Dockerfile, README
- Jest: single-flight refresh, session expiry vs transient errors, token save on login change,
  logout revoke, IAB viewability, safe URLs, HTML escaping, password policy, ad session id
- test:ci with explicit testMatch (dot-directories in worktree paths hid all tests)
- nginx: gzip, nosniff/Referrer-Policy/X-Frame-Options, no-cache for index.html
- Dockerfile: npm ci, REACT_APP_WS_ERROR_QUEUE build arg
- README: new backend contracts, flags, compatibility notes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 11:56:39 +03:00

39 lines
1.5 KiB
Nginx Configuration File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

server {
listen 80;
root /usr/share/nginx/html;
index index.html;
# Сжатие JS/CSS/JSON/SVG: бандл CRA без него весит в 3–4 раза больше
gzip on;
gzip_comp_level 5;
gzip_min_length 1024;
gzip_types text/css application/javascript application/json image/svg+xml text/plain;
# Базовые заголовки безопасности. CSP не задаём: Яндекс.Карты, MinIO и
# домен API нужно сначала перечислить (см. README, «Безопасность»).
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header X-Frame-Options "DENY" always;
# Хешированные файлы CRA — навсегда в кэш
location /static/ {
expires 1y;
add_header Cache-Control "public, immutable";
# add_header в location отменяет заголовки уровня server — повторяем
add_header X-Content-Type-Options "nosniff" always;
}
# index.html не кэшируем: иначе после деплоя браузер держит старую
# страницу со ссылками на удалённые бандлы (белый экран)
location = /index.html {
add_header Cache-Control "no-cache";
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header X-Frame-Options "DENY" always;
}
location / {
try_files $uri /index.html;
}
}