# openresty/lua-nginx-module

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/openresty-lua-nginx-module).**

11,764 stars · 2,049 forks · C

## Links

- GitHub: https://github.com/openresty/lua-nginx-module
- Homepage: https://openresty.org/
- awesome-repositories: https://awesome-repositories.com/repository/openresty-lua-nginx-module.md

## Description

This project is an NGINX module that embeds the Lua scripting language directly into the server environment. It functions as a request processor and response filter, enabling the execution of scripts to handle HTTP requests, generate dynamic content, and manage server behavior without external application calls.

The module provides a shared memory dictionary and cache manager, allowing data to be stored and retrieved across all active worker processes. This capability supports the collection of high-performance server metrics and the synchronization of information across concurrent processes.

The system covers a broad range of programmable server extensions, including custom HTTP middleware, dynamic request routing, and programmable access control for validating client identity. It also includes tools for intercepting and transforming response bodies and headers, modifying request URIs during the rewrite phase, and executing initialization code during server startup.

## Tags

### Programming Languages & Runtimes

- [Embedded Scripting Engines](https://awesome-repositories.com/f/programming-languages-runtimes/embedded-scripting-engines.md) — Integrates a Lua scripting engine directly into the NGINX server to handle requests and generate dynamic content.
- [Non-Blocking Suspension Points](https://awesome-repositories.com/f/programming-languages-runtimes/code-block-execution/non-blocking-suspension-points.md) — Implements non-blocking suspension points using coroutines to handle I/O operations without stalling the main server thread.
- [Just-In-Time Compilers](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/runtime-environments/execution-engines/just-in-time-compilers.md) — Embeds a just-in-time compiler to execute scripts with near-native performance directly within the server process.
- [C Function Bindings](https://awesome-repositories.com/f/programming-languages-runtimes/language-interoperability/native-c-interoperability/c-function-bindings.md) — Provides a foreign function interface to map native C functions to Lua methods for direct server internal access.

### Data & Databases

- [Shared Memory Configuration Stores](https://awesome-repositories.com/f/data-databases/shared-memory-transports/shared-memory-configuration-stores.md) — Provides a shared memory dictionary for synchronizing state and configuration across all active worker processes. ([source](https://github.com/openresty/lua-nginx-module/blob/master/README.markdown))

### Development Tools & Productivity

- [Request Path Rewriters](https://awesome-repositories.com/f/development-tools-productivity/path-managers/path-modifiers/request-path-rewriters.md) — Provides the ability to programmatically modify request URIs and implement dynamic redirects during the server rewrite phase. ([source](https://github.com/openresty/lua-nginx-module/blob/master/README.markdown))

### Networking & Communication

- [Lifecycle Request Handlers](https://awesome-repositories.com/f/networking-communication/communication-protocols-architectures/request-processing-architectures/request-execution/lifecycle-request-handlers.md) — Executes lifecycle-specific request handlers to rewrite URIs and control access during the NGINX request flow.
- [Server Extensions](https://awesome-repositories.com/f/networking-communication/server-extensions.md) — Embeds the Lua scripting language directly into NGINX to process HTTP requests and generate responses.
- [Response Body Modifiers](https://awesome-repositories.com/f/networking-communication/network-reliability-diagnostics/network-interception-tools/response-body-modifiers.md) — Programmatically alters or transforms HTTP response bodies before they are transmitted to the client. ([source](https://github.com/openresty/lua-nginx-module/blob/master/README.markdown))

### Security & Cryptography

- [Scriptable Access Controls](https://awesome-repositories.com/f/security-cryptography/identity-based-access-control/scriptable-access-controls.md) — Implements programmable access control that validates client identity and request metadata via Lua scripts to permit or block traffic. ([source](https://github.com/openresty/lua-nginx-module/blob/master/README.markdown))
- [Identity-Based Access Control](https://awesome-repositories.com/f/security-cryptography/identity-based-access-control.md) — Provides programmable access control to validate client identity and metadata before traffic reaches the backend.

### Software Engineering & Architecture

- [Request Lifecycle Phases](https://awesome-repositories.com/f/software-engineering-architecture/execution-models/request-lifecycle-phases.md) — Executes scripts at specific lifecycle points to manage rewrites, access control, and response generation.
- [Custom Middleware Implementations](https://awesome-repositories.com/f/software-engineering-architecture/middleware/custom-middleware-implementations.md) — Implements custom middleware to intercept request-response cycles for header transformation and custom server behavior.
- [Shared Memory Management](https://awesome-repositories.com/f/software-engineering-architecture/shared-memory-management.md) — Manages shared memory segments to synchronize state and session data across concurrent worker processes.
- [Request Context Management](https://awesome-repositories.com/f/software-engineering-architecture/request-context-management.md) — Maintains a per-request memory context to pass data and state across different execution phases.

### Web Development

- [HTTP Request Handling](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/http-request-handling.md) — Processes incoming HTTP requests and generates responses using embedded Lua scripts. ([source](https://github.com/openresty/lua-nginx-module/blob/master/README.markdown))
- [Request Routing](https://awesome-repositories.com/f/web-development/request-routing.md) — Enables dynamic request routing and URI modification using Lua scripts to implement complex dispatch logic.
- [Response Header Modifiers](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/http-response-handling/response-metadata-accessors/response-header-modifiers.md) — Provides utilities for dynamically updating HTTP response headers using Lua scripts before the response is sent to the client. ([source](https://github.com/openresty/lua-nginx-module/blob/master/README.markdown))
- [Embedded Web Frameworks](https://awesome-repositories.com/f/web-development/embedded-web-frameworks.md) — Allows running Lua scripts within the server for custom request handling and dynamic content generation.
- [Server Initialization Hooks](https://awesome-repositories.com/f/web-development/server-initialization-hooks.md) — Executes custom setup code and initializes shared memory through hooks that run when the server starts. ([source](https://github.com/openresty/lua-nginx-module/blob/master/README.markdown))

### System Administration & Monitoring

- [Server Metrics](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/observability-platforms/metric-performance-monitors/server-metrics.md) — Collects high-performance server metrics and custom request data using shared memory dictionaries.
- [Request Logging](https://awesome-repositories.com/f/system-administration-monitoring/request-logging.md) — Captures custom request details and metrics during the logging phase for system observability. ([source](https://github.com/openresty/lua-nginx-module/blob/master/README.markdown))

### Testing & Quality Assurance

- [HTTP Response Filters](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/network-api-mocking/api-response-modifiers/dynamic-response-filters/http-response-filters.md) — Intercepts and transforms HTTP response bodies and headers using programmable scripts.

### Part of an Awesome List

- [Scripting Language Integration](https://awesome-repositories.com/f/awesome-lists/devtools/scripting-language-integration.md) — Embeds the Lua scripting language into Nginx.
