A List of OpenResty / Nginx modules, Lua libraries, and related resources.
OpenResty is a full-fledged web platform by integrating the standard Nginx core, LuaJIT, many carefully written Lua libraries, lots of high quality 3rd-party Nginx modules, and most of their external dependencies. It is designed to help developers easily build scalable web applications, web services, and dynamic web gateways.
By taking advantage of various well-designed Nginx modules (most of which are developed by the OpenResty team themselves), OpenResty effectively turns the nginx server into a powerful web app server, in which the web developers can use the Lua programming language to script various existing nginx C modules and Lua modules and construct extremely high-performance web applications that are capable to handle 10K ~ 1000K+ connections in a single box.
OpenResty aims to run your server-side web app completely in the Nginx server, leveraging Nginx's event model to do non-blocking I/O not only with the HTTP clients, but also with remote backends like MySQL, PostgreSQL, Memcached, and Redis.
Real-world applications of OpenResty range from dynamic web portals and web gateways, web application firewalls, web service platforms for mobile apps/advertising/distributed storage/data analytics, to full-fledged dynamic web applications and web sites. The hardware used to run OpenResty also ranges from very big metals to embedded devices with very limited resources. It is not uncommon for our production users to serve billions of requests daily for millions of active users with just a handful of machines.
OpenResty is not an Nginx fork. It is just a software bundle. Most of the patches applied to the Nginx core in OpenResty have already been submitted to the official Nginx team and most of the patches submitted have also been accepted. We are trying hard not to fork Nginx and always to use the latest best Nginx core from the official Nginx team.
- Web Site: http://openresty.org/
- Mailing List: https://groups.google.com/forum/#!forum/openresty-en (Chinese List)
- Github Organization: https://github.com/openresty
- Lead Developer: @agentzh
There are at least three different ways to contribute:
- Create a New Issue where you describe the needed additions, deletions or changes.
- Fork this repository and make the changes, and create a pull request.
- Post a reply in the awesome-resty thread in openresty-en mailing list.
- Modules
- Libraries
- Core Libraries
- Web Frameworks
- Web Development Essentials
- Middleware and API Tools
- Templating
- Validation
- Authentication and Authorization
- Cryptography
- Networking
- Databases and Storages
- Testing and Profiling
- Message Queuing and Task Management
- Bar Codes and QR Codes
- Utilities
- Date and Time
- Compression
- Text Formats
- Document Formats
- Image Formats
- Localization
- Caching
- Metrics and Statistics
- Logging
- Web APIs
- Other Sources for Libraries
- Books and Tutorials
- Videos
- Conferences, Workshops and Events
- Demo Applications
- See Also
- License
Core modules come bundled in OpenResty package.
- ngx_openresty — Turning Nginx into a full-fledged Web App Server - Sources for OpenResty Bundle Generation
- lua-nginx-module — Embed the power of Lua into Nginx
- echo-nginx-module — An Nginx module for bringing the power of "echo", "sleep", "time" and more to Nginx's config file
- xss-nginx-module — Native support for cross-site scripting (XSS) in an nginx
- set-misc-nginx-module — Various set_xxx directives added to nginx's rewrite module (md5/sha1, sql/json quoting, and many more)
- encrypted-session-nginx-module — Encrypt and decrypt Nginx variable values
- srcache-nginx-module — Transparent subrequest-based caching layout for arbitrary nginx locations
- lua-upstream-nginx-module — Nginx C module to expose Lua API to ngx_lua for Nginx upstreams
- headers-more-nginx-module — Set and clear input and output headers...more than "add"!
- array-var-nginx-module — Add support for array variables to nginx config files
- memc-nginx-module — An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands
- redis2-nginx-module — Nginx upstream module for the Redis 2.0 protocol
- rds-json-nginx-module — An nginx output filter that formats Resty DBD Streams generated by ngx_drizzle and others to JSON
- rds-csv-nginx-module — Nginx output filter module to convert Resty-DBD-Streams (RDS) to Comma-Separated Values (CSV)
- drizzle-nginx-module — An Nginx upstream module that talks to mysql and drizzle by libdrizzle
- ngx_postgres — Upstream module that allows Nginx to communicate directly with PostgreSQL database
- form-input-nginx-module — This is a nginx module that reads HTTP POST and PUT request body encoded in "application/x-www-form-urlencoded", and parse the arguments in request body into nginx variables.
- ngx_coolkit — Collection of small and useful nginx add-ons
Please also note that there is resty
command line client included in OpenResty bundle. The command line client sources can be found on Github.
- Please refer Nginx Documentation about the Core Nginx Modules.
- ngx_pagespeed (Github) — Automatic PageSpeed optimization module for Nginx
- ModSecurity — Open Source Web Application Firewall
- NAXSI — NAXSI is an open-source, high performance, low rules maintenance WAF for NGINX; NAXSI means Nginx Anti Xss & Sql Injection
- nginx-upsync-module — Nginx C module, syncing upstreams from consul or others, dynamiclly adjusting backend servers weight, needn't reload nginx
- sass-nginx-module — Syntactically Awesome Nginx Module
- More 3rd Party Modules
Core Libraries are bundled in OpenResty package, and you don't need to separately install them.
- lua-resty-core — New FFI-based Lua API for the ngx_lua module
- lua-resty-upstream-healthcheck — Health Checker for Nginx Upstream Servers in Pure Lua
- lua-resty-string — String utilities and common hash functions for ngx_lua and LuaJIT
- lua-resty-lock — Simple nonblocking lock API for ngx_lua based on shared memory dictionaries
- lua-resty-lrucache — Lua-land LRU Cache based on LuaJIT FFI
- lua-resty-dns — DNS resolver for the Nginx Lua module
- lua-resty-upload — Streaming reader and parser for HTTP file uploading based on ngx_lua cosocket
- lua-resty-websocket — Lua WebSocket implementation for the ngx_lua module
- lua-resty-mysql — Non-blocking Lua MySQL client driver for ngx_lua based on the cosocket API
- lua-resty-memcached — Lua memcached client driver for the ngx_lua based on the cosocket API
- lua-resty-redis — Lua Redis client driver for the ngx_lua based on the cosocket API
- lua-redis-parser — Redis reply parser and request constructor library for Lua
- lua-rds-parser — Resty-DBD-Stream (RDS) parser for Lua written in C
- lua-cjson — Lua cJSON is a fast JSON encoding / parsing module for Lua
- Lapis — Lapis is a framework for building web applications using MoonScript or Lua that runs inside of a customized version of Nginx called OpenResty
- lor (Github) — A fast and minimalist web framework based on OpenResty
- Vanilla — An OpenResty Web Framework
- Lusty — Lua RESTful Web Application Framework, an extensible and speedy web framework
- GIN — A fast, low-latency, low-memory footprint, web JSON-API framework with Test Driven Development helpers and patterns
- Quick Server — A Server Framework Based on OpenResty
- Sailor — A Lua MVC Web Framework
- lua-resty-rack — A simple and extensible HTTP server framework for OpenResty
- MOOCHINE — A simple and lightweight web framework based on OpenResty
- sinatra-openresty — Sinatra ported to OpenResty framework
- lj-web — Lightweight Web Framework Based On ngx_openresty
- Gimlet Cocktail — A micro web application framework for OpenResty written in Moonscript inspired by Martini & Sinatra
- durap — Durap is a Lua Web Framework based on OpenResty.
- Ziggy Stardust — Ziggy Stardust (or just "stardust") is a simple nginx/Lua framework inspired by Sinatra, Express, and Mercury
- zLua — A Codeigniter like Lua framework based on OpenResty
- lua-resty-stack — OpenResty Simple Application Stack
- dodolu — A lightweight web framework based on OpenResty
- Octopus (Github) — The Lua Web Platform
- vicky — A restful framework for openresty,inspired by expressjs and koa.
- lua-resty-cookie — Lua library for HTTP cookie manipulations for OpenResty/ngx_lua
- lua-resty-session — Session library for OpenResty implementing Secure Cookie Protocol
- lua-resty-reqargs — Helper to Retrieve application/x-www-form-urlencoded, multipart/form-data, and application/json Request Arguments
- lua-resty-woothee — The Lua-Openresty implementation of Project Woothee, which is a multi-language user-agent strings parsers
- lua-resty-r3 — libr3 OpenResty implementation, libr3 is a high-performance path dispatching library. It compiles your route paths into a prefix tree (trie). By using the constructed prefix trie in the start-up time, you may dispatch your routes with efficiency
- router.lua — A barebones router for Lua, it matches urls and executes lua functions
- lua-resty-mobile — This library parses HTTP headers and detects mobile device*
- lua-resty-jwt — JWT (JSON Web Tokens) for The Great OpenResty
- lua-resty-post — HTTP Post Utility for OpenResty (File Uploading Helper)
- neturl — URL and Query string parser, builder, normalizer for Lua
- Kong (GitHub) — KONG: Microservice Management Layer (Secure, Manage & Extend your APIs and Microservices)
- LSSO — A Lightweight SSO middleware for Nginx + Lua
- apigateway — A Performant API Gateway based on Nginx and OpenResty
- lua-resty-template — A Compiling (HTML) templating engine for Lua and OpenResty
- lemplate — OpenResty/Lua template framework implementing Perl's TT2 templating language
- etlua — Embedded Lua templates
- lua-resty-tmpl — A simple template engine for Lua and OpenResty, derived from lua-template.
- Alternatives — Some alternative Lua templating solutions that may work just fine with OpenResty
- lua-resty-validation — An extendable chaining validation and filtering library for Lua and OpenResty
- valua — Validation for lua! A module for making chained validations. Create your objects, append your tests, use and reuse it!
- lua-resty-macaroons — LuaJIT FFI Bindings to libmacaroons – Macaroons are flexible authorization credentials that support decentralized delegation, attenuation, and verification
- lua-resty-openidc — lua-resty-openidc is a library for NGINX implementing the OpenID Connect Relying Party (RP) and the OAuth 2.0 Resource Server (RS) functionality
- lua-resty-string — String utilities and common hash functions for ngx_lua and LuaJIT
- lua-resty-nettle — LuaJIT FFI bindings for Nettle (a low-level cryptographic library)
- lua-resty-chash — A generic consistent hash implementation for OpenResty/Lua
- lua-resty-jump-consistent-hash — Jump Consistent Hash for LuaJIT
- lua-resty-letsencrypt — Automatically fetch and renew TLS certificates on the fly using LetsEncrypt CA.
- lua-resty-auto-ssl — On the fly (and free) SSL registration and renewal inside OpenResty/nginx with Let's Encrypt
- lua-resty-murmurhash2 — LuaJIT MurmurHash 2 bindings to Nginx / OpenResty murmurhash2 implementation
- lua-resty-hmac — Lua driver for making and receiving hmac signed requests
- lua-resty-scrypt — LuaJIT FFI-based scrypt library for OpenResty
- lua-resty-xxhash — LuaJIT FFI-bindings to xxHash, an Extremely fast non-cryptographic hash algorithm
- lua-resty-rsa — RSA functions for LuaJIT
- lua-resty-hawk — Hawk authentication on Nginx with Lua and OpenResty
- lua-resty-urandom — Buffered wrapper for Linux/BSD kernel space CSPRNG
- lua-resty-fastpbkdf2 — Lua bindings to fastpbkdf2
- lua-argon2-ffi — LuaJIT FFI binding for the Argon2 password hashing algorithm
- lua-resty-http by @pintsized — Lua HTTP client cosocket driver for OpenResty / ngx_lua
- lua-resty-http by @liseen — Lua http client driver for the ngx_lua based on the cosocket API
- lua-resty-http by @DorianGray — Lua HTTP client driver for ngx_lua based on the cosocket API
- lua-resty-http-simple — Simple Lua HTTP client driver for ngx_lua
- lua-resty-httpipe — Lua HTTP client cosocket driver for OpenResty / ngx_lua
- lua-resty-httpclient — Nonblocking Lua HTTP Client library for aLiLua & ngx_lua
- lua-httpcli-resty — Lua HTTP client module for OpenResty
- lua-resty-websocket — Lua WebSocket implementation for the ngx_lua module
- lua-resty-iputils — Utility functions for working with IP addresses in OpenResty
- lua-resty-readurl — Lua library for capturing urls, decoding, and logging results
- lua-resty-socks5 — Lua SOCKS5 client for the ngx_lua based on the cosocket API
- lua-resty-waf — High-performance WAF built on the OpenResty stack
- lua-resty-tarpit — OpenResty response time inflation, capture and delay unwanted requests
- lua-resty-jsonrpc-batch — JSON-RPC 2.0 Batch Request protocol module for OpenResty
- lua-resty-limit-traffic — Lua library for limiting and controlling traffic in OpenResty/ngx_lua
- lua-resty-limits — Limits request every second or minute
- lua-resty-fastcgi — Lua FCGI client driver for ngx_lua based on the cosocket API
- lua-resty-ftpclient — Lua FTP client driver for the ngx_lua based on the cosocket API
- lua-capnproto — Cap’n Proto is an insanely fast data interchange format and capability-based RPC system
- lua-resty-tornera — A traffic replay tool with an easy to use HTTP API for OpenResty / LuaJIT
- lua-resty-mysql — Non-blocking Lua MySQL client driver for ngx_lua based on the cosocket API
- lua-resty-postgres — Nonblocking Lua PostgreSQL driver library for ngx_lua
- pgmoon — A pure Lua Postgres driver for use in OpenResy & more
- lua-resty-orm — Simple ORM for OpenResty
- lua-resty-model — An easy-to-use sql mapper
- lua-resty-memcached — Lua memcached client driver for the ngx_lua based on the cosocket API
- lua-resty-redis — Lua Redis client driver for the ngx_lua based on the cosocket API
- lua-resty-redis-connector — Connection utilities for lua-resty-redis, making it easy and reliable to connect to Redis hosts, either directly or via Redis Sentinel
- lua-resty-redis-cluster — OpenResty Redis Cluster Client
- lua-resty-cassandra — Pure Lua Cassandra client using CQL binary protocol
- lua-cassandra - Pure Lua, feature-rich, and cluster-aware Cassandra client
- lua-resty-bloomd — A client library based on ngx_lua to interface with bloomd servers
- lua-resty-riak — Lua riak protocol buffer client driver for the ngx_lua based on the cosocket API
- lua-resty-mongol — Native Lua Mongodb driver which supports both luasocket and ngx_lua based on the cosocket API
- lua-resty-mongo — Lua mongodb client driver for the ngx_lua based on the cosocket API
- lua-mongo — A simple Lua Mongo driver (a fork made to work with co-sockets)
- lua-resty-kyototycoon — Lua client driver for KyotoTycoon using its native wire protocol (OpenResty/ngx_lua)
- lua-resty-tarantool — Library for working with Tarantool from Nginx with the embedded Lua module or with OpeRresty
- lua-nginx-tarantool — A driver for a NoSQL database in a Lua script Tarantool build on fast nginx cosockets
- lua-resty-ssdb — Lua ssdb client driver for the ngx_lua based on the cosocket API, SSDB is a leveldb server
- ledis-openresty — Lua LedisDB client driver for the ngx_lua based on the cosocket API
- lua-resty-fastdfs — Nonblocking Lua FastDFS driver library for ngx_lua
- openresty-statsd — A Lua module for OpenResty to send metrics to StatsD
- Test::Nginx — Data-driven test scaffold for Nginx C module and OpenResty Lua library development (see real-word tests in lua-resty-redis)
- nginx-systemtap-toolkit — Real-time analyzing and diagnosing tools for Nginx based on SystemTap
- stapxx — Simple macro language extentions to systemtap
- FlameGraph — Flame graphs are a visualization of profiled software, allowing the most frequent code-paths to be identified quickly and accurately
- lua-resty-busted — Test OpenResty scripts with busted
- lua-resty-test — Test frame based on OpenResty
- busted (Github) — Elegant Lua unit testing
- Telescope (Github) — Telescope is a highly customizable test library for Lua that allows for declarative tests with nested contexts
- lua-resty-qless — Lua binding to Qless (Queue / Pipeline management) for OpenResty (see also: Qless Web Interface implemented with OpenResty)
- lua-resty-rabbitmqstomp — Lua RabbitMQ client library which uses cosocket api for communication over STOMP 1.2 with a RabbitMQ broker which has the STOMP plugin
- lua-resty-gearman — Lua gearman client driver for the ngx_lua based on the cosocket API
- lua-resty-kafka — Lua kafka client driver for the ngx_lua based on the cosocket API
- lua-resty-beanstalkd — Lua beanstalkd client driver for the ngx_lua based on the cosocket API
- lua-resty-ironmq — Simple IronMQ client for OpenResty
- lua-resty-QRcode — QR encode tool for ngx_lua
- lua-resty-QRDecode — QR decoder for ngx_lua
- lua-resty-worker-events — Inter process events for Nginx worker processes
- lua-resty-batch — Merge multiple requests in nginx to a single sub-request
- lua-resty-shell — Tiny non-blocking subprocess / shell library to use with OpenResty application server (using sockproc)
- lua-resty-fileinfo — LuaJIT FFI bindings to libmagic, magic number recognition library - tries to determine file types
- lua-resty-taglib - LuaJIT FFI bindings for TagLib - An Audio Meta-Data Library
- lua-resty-uuid — LuaJIT FFI bindings for libuuid, a DCE compatible Universally Unique Identifier library
- lua-resty-jit-uuid — A pure LuaJIT (no dependencies) uuid generator tuned for performance
- lua-resty-tsort — Performs a topological sort on input data
- lua-resty-postal — LuaJIT FFI Bindings to libpostal – a fast statistical parser/normalizer for street addresses around the world.
- lua-resty-libinjection — LuaJIT FFI bindings for libinjection, a SQL/SQLi tokenizer and analyzer
These libraries are not build to using lua-nginx-module
s date time functions (except luatz) like ngx.today
, ngx.time
, ngx.now
, ngx.localtime
, or ngx.utctime
, but they may still come handy. At some point we may need a more "official" time library for OpenResty.
- luatz — A Lua library for time and date manipulation (has a fallback to
ngx.now
) - LuaDate — Lua Date and Time module for Lua 5.x
- SciLua Time Library — Library for the manipulation of dates and periods according to the Gregorian calendar, i.e. the internationally accepted calendar for most uses
- lua-resty-snappy — LuaJIT FFI bindings for Snappy, a fast compressor/decompressor
- lua-resty-hoedown — LuaJIT FFI bindings to Hoedown, a standards compliant, fast, secure markdown processing library in C
- lua-gumbo — Lua bindings for the Gumbo HTML5 parsing library, with a set of DOM APIs implemented in pure Lua
- lua-resty-sass — LuaJIT FFI bindings for libsass - A C/C++ implementation of a Sass compiler (http://libsass.org/).
- lua-resty-lanli — LuaJIT FFI Bindings to Lanli HTML Sanitizer Library
- lua-resty-ini — Lua INI-file parser
- lua-re2 — C and Lua wrapper for RE2 regular expression library.
- lua-aho-corasick — C++ and Lua Implementation of the Aho-Corasick (AC) string matching algorithm
- lua-resty-json — JSON library for Lua and C (decoder only).
- lua-resty-libcjson — LuaJIT FFI-based cJSON library for OpenResty
- lua-resty-prettycjson — Lua cJSON Pretty Formatter
- lua-resty-utf8rewind — LuaJIT FFI bindings for utf8rewind - a system library written in C designed to extend the default string handling functions with support for UTF-8 encoded text
- lua-resty-unistring — LuaJIT FFI bindings for GNU libunistring - A Unicode string manipulation lIbrary (https://www.gnu.org/software/libunistring/)
- lua-resty-libxl — LuaJIT FFI-based LibXL (Excel) library for OpenResty
- lua-resty-haru — LuaJIT FFI-based libHaru (PDF) library for OpenResty
- lua-resty-hpdf — LuaJIT FFI-based libHaru (PDF) library for OpenResty
- Lua IMagick — Lua Pure-C Bindings to ImageMagick
- magick — Lua Bindings to ImageMagick for LuaJIT using FFI
- giflib — Lua bindings to GIFLIB for LuaJIT using FFI
- fi-luajit — A LuaJIT interface to FreeImage
- lua-resty-gettext — LuaJIT FFI-based gettext library for OpenResty
- lua-resty-lrucache — Lua-land LRU Cache based on LuaJIT FFI
- lua-resty-tlc — Two Layer Cache implementation using lua-resty-lrucache and shared dictionaries.
- Ledge — A Lua application for OpenResty, providing HTTP cache functionality for Nginx, using Redis as a cache / metadata store
- lua-resty-cache — HTTP Cache to Redis, can serve stale response, and using
lua-resty-lock
only allow one request to populate a new cache
- LUAMETER — A Lua module for Nginx that records and provides key status and performance metrics, right from within Nginx and in real-time (Proprietary)
- ngxtop — Real-Time metrics for nginx server
- lua-resty-logger-socket — Raw-socket-based Logger Library for Nginx (based on ngx_lua)
- raven-lua — A small Lua interface to Sentry
- lua-nginx-logging — Logging utilities for Nginx written in Lua
- lua-resty-logger — Custom Logger Library for OpenResty
- lua-resty-github — Lua library for using the github api in the ngx_lua nginx module
- lua-resty-hipchat — Lua library for using the hipchat api
- api-gateway-aws — Lua module for AWS APIs. The missing AWS SDK from Nginx / OpenResty. Use it to proxy AWS APIs in a simple fashion, with any HTTP Client that you prefer.
- lua-resty-aws — AWS signature V4 library for OpenResty + Lua
- lua-resty-s3 — Lua driver for uploading content to Amazon S3
- lua-resty-s3uploader — An AWS S3 upload client,easy to use
- lua-resty-paypal — Lua Paypal client using express checkout for OpenResty
- lua-resty-17monip — 17MonIP parsing library for ngx_lua
- lua-resty-upyun — Upyun cloud-based platform
- lua-resty-newrelic — New Relic bindings for a OpenResty / Lua
- lua-mailgun — A Lua library for sending emails and interacting with the Mailgun API. Compatible with OpenResty via Lapis HTTP API, or any other Lua script via LuaSocket.
- lua-payments — Bindings to various payment provider APIs for use in Lua (with OpenResty or anything that supports LuaSocket)
- LuaRocks Repository (Search for resty libraries in LuaRocks)
- Github Search for lua-resty-* Libraries
- Lua Toolbox
- luapower — Lua, JIT, batteries
- List of Available LuaJIT Packages
- List of Available LuaJIT FFI Bindings
- Programming OpenResty — Scripting an NGINX-based Web Platform (Work-in-Progress)
- OpenResty Best Practices (GitBook) (Chinese, use e.g. Google Translate)
- agentzh's Nginx Tutorials
- Definitely an OpenResty Guide
- Top ten things about OpenResty
- The Latest and Greatest from ngx_lua: New Features & Tools (Summary, Slides, PDF, Video)
- Nginx Configuration Snippets — A collection of useful Nginx configuration snippets
- Getting started with Lapis, the web framework
- Building an HTTP request router with NGINX and Lua - Shopify (Nginx Conf 2015)
- Enabling TLS Cross host Session Resumption with Forward Secrecy via ngx lua (Nginx Conf 2015)
- The Latest and Greatest from ngx_lua: New Features & Tools (Nginx Conf 2014)