A List of OpenResty / Nginx modules, Lua libraries, and related
resources.
What is OpenResty
OpenResty Logo
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.
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
ngx_devel_kit —
an Nginx module that adds additional generic tools that module
developers can use in their own modules
Please also note that there is resty
command line client included in OpenResty bundle. The command line client
sources can be found on Github.
Core Nginx Modules
To learn more about Nginx Core Modules, please refer Nginx Documentation. Some modules
that come with Nginx are (not all of them are build by default):
ngx_http_ssl_module
— The ngx_http_ssl_module module provides the necessary support for
HTTPS
ngx_http_v2_module
— The ngx_http_v2_module module provides support for HTTP/2
ngx_http_realip_module
— The ngx_http_realip_module module is used to change the client address
and optional port to the one sent in the specified header fields
ngx_http_addition_module
— The ngx_http_addition_module module is a filter that adds text before
and after a response
ngx_http_xslt_module
— The ngx_http_xslt_module is a filter that transforms XML responses
using one or more XSLT stylesheet
ngx_http_image_filter_module
— The ngx_http_image_filter_module module is a filter that transforms
images in JPEG, GIF, and PNG formats
ngx_http_geoip_module
— The ngx_http_geoip_module module creates variables with values
depending on the client IP address, using the precompiled MaxMind
databases
ngx_http_sub_module
— The ngx_http_sub_module module is a filter that modifies a response by
replacing one specified string by another
ngx_http_dav_module
— The ngx_http_dav_module module is intended for file management
automation via the WebDAV protocol. The module processes HTTP and WebDAV
methods PUT, DELETE, MKCOL, COPY, and MOVE
ngx_http_flv_module
— The ngx_http_flv_module module provides pseudo-streaming server-side
support for Flash Video (FLV) files
ngx_http_mp4_module
— The ngx_http_mp4_module module provides pseudo-streaming server-side
support for MP4 files. Such files typically have the .mp4, .m4v, or .m4a
filename extensions
ngx_http_gunzip_module
— The ngx_http_gunzip_module module is a filter that decompresses
responses with “Content-Encoding: gzip” for clients that do not support
“gzip” encoding method. The module will be useful when it is desirable
to store data compressed to save space and reduce I/O costs
ngx_http_gzip_static_module
— The ngx_http_gzip_static_module module allows sending precompressed
files with the “.gz” filename extension instead of regular files
ngx_http_auth_request_module
— The ngx_http_auth_request_module module implements client
authorization based on the result of a subrequest
ngx_http_random_index_module
— The ngx_http_random_index_module module processes requests ending with
the slash character (‘/’) and picks a random file in a directory to
serve as an index file
ngx_http_secure_link_module
— The ngx_http_secure_link_module module (0.7.18) is used to check
authenticity of requested links, protect resources from unauthorized
access, and limit link lifetime
ngx_http_slice_module
— The ngx_http_slice_module module is a filter that splits a request
into subrequests, each returning a certain range of response
ngx_http_stub_status_module
— The ngx_http_stub_status_module module provides access to basic status
information
ngx_http_charset_module
— The ngx_http_charset_module module adds the specified charset to the
“Content-Type” response header field
ngx_http_gzip_module
— The ngx_http_gzip_module module is a filter that compresses responses
using the “gzip” method
ngx_http_ssi_module
— The ngx_http_ssi_module module is a filter that processes SSI (Server
Side Includes) commands in responses passing through it
ngx_http_userid_module
— The ngx_http_userid_module module sets cookies suitable for client
identification
ngx_http_access_module
— The ngx_http_access_module module allows limiting access to certain
client addresses
ngx_http_auth_basic_module
— The ngx_http_auth_basic_module module allows limiting access to
resources by validating the user name and password using the “HTTP Basic
Authentication” protocol
ngx_http_autoindex_module
— The ngx_http_autoindex_module module processes requests ending with
the slash character (‘/’) and produces a directory listing
ngx_http_geo_module
— The ngx_http_geo_module module creates variables with values depending
on the client IP address
ngx_http_map_module
— The ngx_http_map_module module creates variables whose values depend
on values of other variables
ngx_http_split_clients_module
— The ngx_http_split_clients_module module creates variables suitable
for A/B testing, also known as split testing
ngx_http_referer_module
— The ngx_http_referer_module module is used to block access to a site
for requests with invalid values in the “Referer” header field
ngx_http_rewrite_module
— The ngx_http_rewrite_module module is used to change request URI using
PCRE regular expressions, return redirects, and conditionally select
configurations
ngx_http_proxy_module
— The ngx_http_proxy_module module allows passing requests to another
server
ngx_http_fastcgi_module
— The ngx_http_fastcgi_module module allows passing requests to a
FastCGI server
ngx_http_uwsgi_module
— The ngx_http_uwsgi_module module allows passing requests to a uwsgi
server
ngx_http_scgi_module
— The ngx_http_scgi_module module allows passing requests to an SCGI
server
ngx_http_memcached_module
— he ngx_http_memcached_module module is used to obtain responses from a
memcached server
ngx_http_limit_conn_module
— The ngx_http_limit_conn_module module is used to limit the number of
connections per the defined key, in particular, the number of
connections from a single IP address
ngx_http_limit_req_module
— he ngx_http_limit_req_module module is used to limit the request
processing rate per a defined key, in particular, the processing rate of
requests coming from a single IP address
ngx_http_browser_module
— The ngx_http_browser_module module creates variables whose values
depend on the value of the “User-Agent” request header field
lua-resty-cookie
— Lua library for HTTP cookie manipulations for OpenResty/ngx_lua
lua-resty-cors —
The Cross-Origin Resource Sharing (CORS) implementation for
OpenResty
lua-resty-session
— Session library for OpenResty implementing Secure Cookie Protocol
lua-resty-woothee
— The Lua-Openresty implementation of Project Woothee, which is a
multi-language user-agent strings parsers
lua-resty-mobile —
This library parses HTTP headers and detects mobile device
lua-resty-jwt —
JWT (JSON Web Tokens) for The Great OpenResty
neturl — URL and
Query string parser, builder, normalizer for Lua
Mio — API
statistics/summary and health datas in NGINX based on OpenResty, just
like NGINX Plus
lua-redis-admin
— redis client tool,redis web client,redis web ui,openresty lor lua
framework support
Routing Libraries
lua-resty-route — A
URL routing library for OpenResty supporting multiple route matchers,
middleware, and HTTP and WebSockets handlers to mention a few of its
features
router.lua — A
barebones router for Lua, it matches URLs and executes Lua
functions
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
lua-resty-libr3 —
High-performance path dispatching library base on libr3 for OpenResty
lua-radix-router -
A lightweight, high-performance, radix tree based and OpenAPI friendly
API Router for Lua / LuaJIT / OpenResty.
Traffic Management
lua-resty-redis-ratelimit
— Limit the request processing rate between multiple NGINX instances
backed by Redis
lua-resty-limit-rate
- Lua module for limiting request rate for OpenResty/ngx_lua, using the
“token bucket” method
Alternatives
— Some alternative Lua templating solutions that may work just fine with
OpenResty
Validation
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!
Authentication and
Authorization
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
micro-auth — A
microservice that makes adding authentication with Google and Github to
your application easy (Note: before using it in production, see:
https://news.ycombinator.com/item?id=13682682 — hopefully we can remove
this remark in a future)
lua-resty-casbin
— Casbin is an authorization library that supports access control models
like ACL, RBAC, ABAC in Lua (OpenResty). This is a Casbin authorization
plugin for OpenResty.
Cryptography
lua-resty-string
— String utilities and common hash functions for ngx_lua and LuaJIT
lua-resty-http2 —
The HTTP/2 Protocol (Client Side) Implementation for OpenResty
lua-tus-server -
Server-side implementation of the tus protocol in Lua
lua-resty-wrr
- weight round robin for Openresty. Similar to
ngx_http/stream_upstream_round_robin module.
lua-resty-dycert -
Dynamically generate a certificate based on a CSR and sign it with a
CA.
Databases and Storages
lua-resty-mysql
— Non-blocking Lua MySQL client driver for ngx_lua based on the cosocket
API
lua-resty-mysql-connector
— Connection utilities for lua-resty-mysql, support for read and write
separation,support for instantiating different databases
lua-resty-postgres
— Nonblocking Lua PostgreSQL driver library for ngx_lua
pgmoon — A pure Lua
Postgres driver for use in OpenResy & more
lua-resty-mvc
— You don’t need that complicated MVC framework! With just a plain
folder with several simple files, you can enjoy basic but most
frequently used MVC features.
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
resty-redis-cluster
— OpenResty Redis cluster-aware client based on resty-redis-cluster
Telescope (Github) — Telescope is a
highly customizable test library for Lua that allows for declarative
tests with nested contexts
Message Queuing and Task
Management
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
Inspect —
Inspect is a library that transforms any Lua value into a human-readable
representation. It is especially useful for debugging errors in
tables.
lua-resty-maxminddb
by @lilien1010 — LuaJIT FFI Bindings to
official libmaxminddb, to get ip location with ip database offered by
maxmind
lua-resty-maxminddb
by @anjia0532 — A Lua library for reading
MaxMind’s Geolocation database format (aka mmdb or geoip2)
These libraries are not build to using lua-nginx-modules
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)
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
Compression
lua-resty-zip —
ZIP functions(compress/uncompress) for LuaJIT
lua-resty-snappy —
LuaJIT FFI bindings for Snappy, a fast compressor/decompressor
lua-laxjson - Lua
binding to a relaxed streaming JSON parser, liblaxjson for LuaJIT
using FFI
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-htmlentities
— Backport the entities to LuaJIT with the FFI binding as the entities
to UTF-8 decoder
raven-lua — A
small Lua interface to Sentry that also has a helpful wrapper function
call() that takes any arbitrary Lua function (with arguments) and
executes it, traps any errors and reports it automatically to
Sentry
Functional Programming
Lua Fun — Lua Fun is
a high-performance functional programming library for Lua designed with
LuaJIT’s trace compiler in mind
Penlight —
Penlight brings together a set of generally useful pure Lua modules,
focusing on input data handling (such as reading configuration files),
functional programming (such as map, reduce, placeholder expressions,
etc), and OS path management
Moses — A Lua
utility-belt library for functional programming. It complements the
built-in Lua table library, making easier operations on arrays, lists,
collections
Underscore.lua —
Underscore.lua is a Lua library that provides a set of utility functions
for dealing with iterators, arrays, tables, and functions
Lodash.lua — A
functional programming library for Lua in respect to the Javascript
library Lodash
lua-resty-newrelic
— Lua newrelic SDK for the ngx_lua based on the C SDK
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-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)
Security
lua-resty-ddos —
This library uses Cookie Validation to detect bots from real users
Nginx-Lua-Anti-DDoS)
— A Anti-DDoS script to protect Nginx web servers using Lua with a
Javascript based authentication puzzle inspired by Cloudflare