Files
java-word-pdf/wordpdf-web/nginx.conf
T

21 lines
1.3 KiB
Nginx Configuration File
Raw 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;
# Security-заголовки (always — чтобы ехали и на 4xx/5xx). CSP: SPA —
# только собственные скрипты/стили (Vite-сборка, внешних CDN нет),
# запросы — на свой origin (/api через шлюз), предпросмотр PDF —
# blob: в iframe (PdfPreview.tsx), inline style-атрибуты React'а
# требуют 'unsafe-inline' в style-src.
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "no-referrer" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; frame-src blob:; connect-src 'self'; base-uri 'self'; form-action 'self'; object-src 'none'" always;
# XFO не конфликтует с blob-iframe предпросмотра: он ограничивает
# встраивание ОТВЕТА этого сервера в чужие страницы; предпросмотр
# встраивает blob-URL, на который заголовок не ставится.
location / { try_files $uri $uri/ /index.html; }
}