Deploying Strapi behind an Nginx Reverse Proxy
Blog post from Strapi
Deploying Strapi 5 behind Nginx improves security by terminating TLS at the proxy, keeping the Node.js process off the public edge, and forwarding requests with headers that preserve the original hostname, protocol, client IP, and WebSocket support. Correct deployment requires both Nginx configuration and Strapi proxy settings, particularly `proxy.koa`, a public HTTPS URL, and bounded forwarded-IP trust, as omissions can cause insecure-cookie login failures, incorrect password-reset or OAuth links, broken admin API calls, and inaccurate client-IP logging. The configuration addresses HTTPS redirection, certificate handling, upload size limits, timeouts, health checks, and connection reuse, while noting that Strapi 5 proxy settings differ from Strapi 4 and that the admin interface must be rebuilt after public URL changes. It also covers subpath hosting, IP-restricted admin access, safe public API caching, and load-balanced deployments that require shared secrets, a common database, and shared media storage. Suggested verification includes checking health endpoints, redirects, login behavior, and large uploads, while common errors such as 502, 413, 504, localhost links, and missing WebSocket functionality are tied to specific proxy or application configuration issues.
No tracked trend matches for this post yet.
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.