Send a CSP and security headers from the frontend's nginx

script-src admits the bundle and the pre-paint theme script by hash, with no
unsafe-inline or unsafe-eval; style-src keeps unsafe-inline for the <style>
elements Monaco, Radix and the toasts insert. frame-ancestors 'self',
nosniff and strict-origin-when-cross-origin go with it, and the Dockerfile
adds the API origin to connect-src when the bundle calls one elsewhere. Zod
runs jitless so its eval probe is not reported on every page. The embed
widget keeps allow-same-origin: the demo's weather map does not render
without it; the comment now says so and what it costs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013GAeg4Jo6xjZzjwy9QDWMQ
This commit is contained in:
2026-10-06 12:30:47 +02:00
co-authored by Claude Opus 5.5
parent b0c601c6ed
commit 6c0ab2049b
7 changed files with 48 additions and 3 deletions
+3 -1
View File
@@ -11,7 +11,9 @@
<link rel="manifest" href="%BASE_URL%manifest.webmanifest" />
<link rel="apple-touch-icon" href="%BASE_URL%apple-touch-icon.png" />
<title>Fluksio</title>
<!-- Set the theme class before first paint so the app never flashes light. -->
<!-- Set the theme class before first paint so the app never flashes light.
The CSP admits this script by its hash (nginx-security-headers.conf):
change the script and that hash changes with it. -->
<script>
(() => {
try {