OpenResty is a full-fledged dynamic web platform based on an enhanced distribution of NGINX and LuaJIT. It integrates a modified version of the Nginx core, an enhanced version of the LuaJIT just-in-time compiler, a collection of carefully written Lua libraries, numerous high-quality third-party Nginx modules, and most of their external dependencies. It is designed to help developers build scalable web applications, web services, and dynamic web gateways.
Overview
OpenResty effectively turns the Nginx web server into a powerful web application server. Developers use the Lua programming language to script existing Nginx C modules and Lua modules, constructing high-performance web applications capable of handling 10,000 to over 1,000,000 concurrent connections on a single machine. By leveraging Nginx's event-driven, non-blocking I/O model, OpenResty can communicate not only with HTTP clients but also with remote backends such as MySQL, PostgreSQL, Memcached, and Redis — all within the server-side Lua environment.
History
OpenResty was originally created by Yichun Zhang (also known as agentzh). It began in October 2007 at Yahoo! China as an Open API web service framework written mostly in Perl. Its initial design was described as "a REST wrapper for relational databases."
In September 2009, OpenResty was redeveloped at Taobao (the Chinese e-commerce company) as ngx_openresty — a Lua application server based upon an extended repackaging of Nginx and LuaJIT, with plug-in server extension modules written in C.
- Before 2011: Primarily sponsored by Taobao.
- 2012–2016: Mainly supported by Cloudflare.
- Since 2017: Primarily supported by the OpenResty Software Foundation and OpenResty Inc.
Key Features
- Dynamic Scripting with Lua: Enables runtime configuration and logic without recompiling Nginx.
- Non-blocking I/O: All operations (file, network, database) are non-blocking by design.
- Comprehensive Module Ecosystem: Bundles modules for cosockets, JSON/MessagePack encoding, DNS resolution, SSL handling, load balancing, and more.
- High Concurrency: Capable of handling tens of thousands to over a million concurrent connections on a single server.
- Not a Fork: OpenResty is not an Nginx fork; it is a higher-level application and gateway platform that uses Nginx as a component. Most patches applied to the Nginx core in OpenResty have been submitted to and accepted by the official Nginx team.
Components
The OpenResty bundle includes, among others:
- Enhanced Nginx core
- Enhanced LuaJIT
- ngx_lua_module — embeds Lua into Nginx
- ngx_http_lua_module — core module for running Lua code in HTTP contexts
- resty.core — LuaJIT FFI-based Nginx API
- Various libraries for Redis, MySQL, PostgreSQL, Memcached, SSL, WebSocket, and more
Real-World Usage
OpenResty is used in production by numerous organizations worldwide. According to OpenResty Inc., it powers over 21 million websites globally. Notable users include Zoom, Alibaba, and Forbes. Common applications include:
- Dynamic web portals and web gateways
- Web application firewalls (WAF)
- API gateways
- Mobile app backends
- Advertising and distributed storage platforms
- Content delivery network (CDN) edge nodes
- Live streaming platforms
Enterprise Offerings
OpenResty Inc., the company founded by Yichun Zhang, provides commercial enterprise solutions built on OpenResty:
- OpenResty Edge — a distributed traffic management and gateway platform.
- OpenResty XRay — a dynamic tracing and production diagnostic analysis tool.
Licensing
OpenResty is released under the FreeBSD License (a permissive open-source license). The source code is hosted on GitHub at github.com/openresty/openresty.
Latest Release
The latest stable release as of mid-2026 is OpenResty 1.31.1.1 (released May 29, 2026).