diff --git a/api/docker/caddy/Caddyfile b/api/docker/caddy/Caddyfile index 39fd55f5f65..f3b4474614b 100644 --- a/api/docker/caddy/Caddyfile +++ b/api/docker/caddy/Caddyfile @@ -44,8 +44,21 @@ route { vulcain push - # Add links to the API docs and to the Mercure Hub if not set explicitly (e.g. the PWA) - header ?Link `; rel="http://www.w3.org/ns/hydra/core#apiDocumentation", ; rel="mercure"` + header { + # Add links to the API docs and to the Mercure Hub if not set explicitly (e.g. the PWA) + ?Link `; rel="http://www.w3.org/ns/hydra/core#apiDocumentation", ; rel="mercure"` + + # Set security headers + + # Enable HTTP Strict Transport Security (HSTS) to force clients to always connect via HTTPS + Strict-Transport-Security "max-age=31536000; preload" + # Enable cross-site filter (XSS) and tell browser to block detected attacks + X-XSS-Protection "1; mode=block" + # Prevent some browsers from MIME-sniffing a response away from the declared Content-Type + X-Content-Type-Options "nosniff" + # Disallow the site to be rendered within a frame (clickjacking protection) + X-Frame-Options "DENY" + } # Comment the following line if you don't want Next.js to catch requests for HTML documents. # In this case, they will be handled by the PHP app.