Home / Companies / Strapi / Blog / Post Details
Content Deep Dive

Deploying Strapi behind an Nginx Reverse Proxy

Blog post from Strapi

Post Details
Company
Date Published
Author
Theodore Kelechukwu Onyejiaku
Word Count
1,406
Company Posts That Month
28
Language
English
Hacker News Points
-
Post removed?
No
Summary

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.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

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.