Production checklist
Configure these settings before serving production traffic.
Configure these settings before serving production traffic.
-
security.allowedHostslists every host name the server answers for (Hosts and proxies). - The proxy overwrites
X-Forwarded-Proto,X-Forwarded-HostandX-Forwarded-For;serve({ trustProxy: true })is on only behind it, andsecurity.trustProxyhas the righthopsandtrustedPeers(Hosts and proxies). -
security.headers.hstsis set once every subdomain works over https (Secure headers). -
security.cspis on, tried withreportOnlyfirst, and every inline script you add carriesevent.nonce(CSP). - CSRF is left on;
trustedOriginslists only origins you control; every route withcsrf = falseverifies a signature (CSRF). -
security.cookieSecretsand the sessionsecretsare 32 characters or more, come from the environment, and rotate with the new secret first (Cookies). - The session cookie is named
__Host-..., sign-in callsregenerate(), sign-out callsdestroy(), and a sharedSessionStorereplaces the memory store when there is more than one process (Sessions). - Sign-in, password reset and expensive routes have their own rate limit, in a shared store when there is more than one process (Rate limiting).
-
defineEnvdescribes every variable, secrets are notDUSK_PUBLIC_, and nothing secret is read fromimport.meta.env(Environment variables). - The limits fit your largest legitimate request; small endpoints use
readTextLimited(Limits). - Redirects that come from input go through
redirect(), andtrustedOriginsis empty or minimal (Redirects). -
onErrorforwards to your logging withevent.id, and production runs thedusk buildoutput (devis false) (Errors in production, Deploy). - The health path is probed by the platform, and the container runs as a non-root user (Deploy).