About OpenResty
OpenResty is a BSD-licensed web platform that compiles the standard NGINX core together with LuaJIT, ngx_lua and lua-resty libraries for Redis, MySQL, DNS, WebSockets and more. Lua code runs inside NGINX's event loop at phases such as access, content and logging.
That makes it a base for API gateways, edge auth, dynamic routing and caching layers that would otherwise need a separate app. On a CloudSat VPS you have root access to tune workers and shared dictionaries for your traffic.
After deploy OpenResty serves its default page on port 80. Configs live under /usr/local/openresty/nginx/conf/, and the resty command runs Lua scripts from the shell.
What you get with OpenResty
- NGINX core with LuaJIT and ngx_lua
- Non-blocking Lua drivers for Redis, MySQL and memcached
- Shared memory dictionaries for counters and caches
- Lua in the stream module for TCP and UDP
opmpackage manager andrestyCLI
OpenResty use cases
- Build an API gateway with custom auth and rate limits
- Route requests dynamically from Redis or a database
- Add edge logic such as A/B tests or token checks
After you deploy OpenResty
- When the server reads Running, open
http://<server IP>/to confirm the default page answers. - Edit
/usr/local/openresty/nginx/conf/nginx.conf, add acontent_by_lua_blockto try Lua, then test the config withopenresty -t. - Reload with
systemctl reload openrestyso workers pick up changes without dropping connections. - Point your domain at the server and add HTTPS with an ACME client before going live.
OpenResty ports
Open these in your firewall if you use one: 80/tcp HTTP, 443/tcp HTTPS.
OpenResty FAQ
Can I use regular NGINX configs with OpenResty?
Yes. It is NGINX underneath, so existing server blocks work; Lua directives are an extra layer you add where needed.
How do I install extra Lua libraries?
Use opm get <package> for libraries published on the OpenResty Package Manager, or LuaRocks for general Lua modules.
Disclaimer. The OpenResty project has no affiliation with CloudSat and does not endorse it. Names and logos belong to their owners and appear only to identify the software.