XUtils

awesome-resty

A list like this one, but focused on OpenResty.


awesome-resty

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.

Official Channels

How to Contribute on this List?

There are at least three different ways to contribute:

  1. Create a New Issue where you describe the needed additions, deletions or changes.
  2. Fork this repository and make the changes, and create a pull request.
  3. Post a reply in the awesome-resty thread in openresty-en mailing list.

Modules

Third-party Nginx Modules

  • lua-var-nginx-module — Fetchs Nginx variable by Luajit with FFI way which is fast and cheap
  • ngx_lua_ipc — Interprocess communication for Lua Nginx Module and OpenResty — send named alerts with string data between Nginx worker processes
  • nchan (Github) — Fast, horizontally scalable, multiprocess pub/sub queuing server and proxy for HTTP, long-polling, Websockets and EventSource (SSE)
  • 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

Libraries

Core Libraries

Core Libraries are bundled in OpenResty package, and you don’t need to separately install them.

Web Frameworks

  • 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
  • luastar — A HTTP server and web framework based on OpenResty
  • 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 — The Lua Web Platform
  • vicky — A restful framework for openresty,inspired by expressjs and koa.
  • fasty - A CMS based on openresty, arangoDB, lapis & riotjs

Traffic Management

Request Argments Parsers

Middleware and API Tools

  • 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
  • 3scale APIcast — API gateway module of Red Hat 3scale API Management
  • Sumory Orange — API Gateway
  • Monarch API Gateway — OpenResty-based API Gateway
  • APISIX — APISIX is a Cloud-Native Microservices API Gateway
  • lua-resty-grpc-gateway — Provides request transformation between REST <-> gRPC with Openresty
  • Slardar - Updating your upstream list and run lua scripts without reloading Nginx
  • tl-ops-manage - Framework for service management based on openresty

Templating

  • lua-resty-template — A Compiling (HTML) templating engine for Lua and OpenResty
  • lemplate — OpenResty/Lua template framework implementing Perl’s TT2 templating language
  • lua-resty-aries — OpenResty and Lua multi-function template, it can correct show your error line
  • etlua — Embedded Lua templates
  • liquid-lua — A Lua implementation of Liquid for OpenResty platform
  • 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

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!

Cryptography

Networking

Testing and Profiling

  • 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

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
  • lua-resty-ironmq — Simple IronMQ client for OpenResty
  • lua-resty-nsqNSQ client for for the ngx_lua based on the cosocket API

Bar Codes and QR Codes

Utilities

Date and Time

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)
  • 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

Compression

Binary Formats

Document Formats

  • 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

Image Formats

  • lua-resty-imagick — Lua bindings to ImageMagick’s MagicWand for LuaJIT using FFI
  • 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-vips — LuaJIT binding for libvips

Localization

Caching

  • lua-resty-lrucache — Lua-land LRU Cache based on LuaJIT FFI
  • lua-resty-mlcache — Modern and flexible multi-level caching using lua-resty-lrucache, shared dictionaries, and cache stampede protection.
  • shcache — shcache is an attempt at using ngx.shared.DICT with a caching state machine layed on top
  • 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

Metrics and Statistics

  • 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-moesif — Lua Client Library for Moesif, compatible with OpenResty

Logging

  • lua-resty-logger-socket — Raw-socket-based Logger Library for Nginx (based on ngx_lua)
  • lua-nginx-logging — Logging utilities for Nginx written in Lua
  • lua-resty-logger — Custom Logger Library for OpenResty
  • lua-resty-rfc5424 — An implementation of the RFC5424(syslog) in the OpenResty
  • lua-resty-fluentd — Lua fluentd logger for the ngx_lua based on the cosocket API
  • lua-resty-fluent-logger — A structured logger for Fluentd (OpenResty / ngx_lua)
  • 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
  • Search for more “Functional Lua” projects on GitHub…

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

Other Sources for Libraries

Books and Tutorials

Books

Tutorials and Guides

Videos

Conferences, Workshops and Events

Demo Applications

See Also


Articles

  • coming soon...