Deploy OpenResty
Programmable Nginx web server with Lua APIs and health checks.
Just deployed
Deploy and Host OpenResty with Railway
OpenResty combines Nginx with LuaJIT and a curated set of high-performance modules for programmable web applications, gateways, and proxies. This template deploys a pinned OpenResty release with sample Lua APIs, a browser landing page, structured logs, security headers, and an HTTP health check.
About Hosting OpenResty
Hosting OpenResty provides an event-driven server that can execute Lua directly in the Nginx request lifecycle. This Railway starter configures the assigned port at container startup, serves a static landing page, exposes testable Lua endpoints, records JSON access logs, and supplies a dedicated readiness endpoint. The included fat image provides OPM and LuaRocks, making it straightforward to add OpenResty libraries while retaining a reproducible base version.
Common Use Cases
- Build lightweight JSON APIs with Lua
- Create programmable reverse proxies and API gateways
- Perform request validation, transformation, and routing at the edge
- Serve static applications with dynamic server-side endpoints
- Prototype high-concurrency web services without a separate application runtime
Dependencies for OpenResty Hosting
- OpenResty 1.31.1.1
- Official Docker packaging revision 2 on Debian Bookworm
- LuaJIT and bundled OpenResty modules
- OPM and LuaRocks package managers
Deployment Dependencies
- OpenResty documentation
- OpenResty Lua API reference
- Official Docker tooling
- Template source repository
Implementation Details
The startup wrapper validates Railway's PORT, renders the Nginx server configuration, and launches OpenResty in the foreground. Lua handlers use the bundled safe JSON encoder. The configuration adds structured access logs, request IDs, a 1 MiB body limit, and baseline browser security headers. The service is stateless and requires no database or persistent volume.
Why Deploy OpenResty on Railway?
Railway provides reproducible source builds, HTTPS networking, deployment health checks, logs, and restart management around OpenResty. This produces a small programmable web platform without managing a host, TLS certificates, or a separate load balancer.
Template Content