A comprehensive guide to consolidating multi-layer Nginx into a single programmable OpenResty gateway, covering Lua request phases, shared-memory rate limiting algorithms (leaky bucket, token bucket, distributed), dynamic configuration, authentication ordering, risk control tiers, performance tuning, and six production troubleshooting scenarios with concrete fixes.
OpenShip is an open‑source, self‑hosted deployment platform that eliminates YAML pipelines, automatically detects project stacks, bundles CI/CD into a clean desktop app, and provides web, CLI, and dashboard interfaces for managing builds, routing, certificates, databases, and scaling—all with a single command.
This article walks through why Nginx needs rate limiting, explains the three core directives, compares burst, nodelay and delay behaviors, shows how to choose keys, and provides step‑by‑step configuration, testing, monitoring and troubleshooting recipes for protecting services from CC attacks and sudden traffic bursts.
The article details how the team built a high‑performance, reliable cloud‑native gateway for millions of AI sandbox VNC sessions, addressing challenges of dynamic pod IPs, multi‑stage Web VNC traffic, session consistency, and security by using OpenResty, Lua scripts, Redis‑backed routing, cookie‑based state storage, and extensive Nginx tuning.
The article details a cloud‑native gateway design that solves the zero‑loss routing and session‑persistence challenges of massive AI sandbox Web VNC streams by dissecting protocol stages, exposing classic gateway pitfalls, and presenting a two‑phase URL‑plus‑cookie routing architecture built on OpenResty, Lua, and Redis.
This article analyses how Nginx evolves from a simple reverse proxy to a unified edge gateway, covering multi‑domain management, dynamic routing, high‑concurrency capacity planning, load‑balancing algorithms, TLS handling, observability, Kubernetes deployment, and practical production pitfalls.
This article walks through the complete engineering process—from Linux kernel tweaks and network stack tuning to Nginx master‑worker design, layered load‑balancing, zero‑copy I/O, rate‑limiting, and OpenResty Lua extensions—demonstrating how to build a production‑grade system that reliably handles one million queries per second.
This article explains the fundamental differences between Nginx and OpenResty, compares their features, performance, and programming models, and provides practical guidance on selecting the right tool for static serving, reverse‑proxying, or complex business‑logic workloads.
This guide presents three practical, production‑grade methods to dynamically block IP addresses in Nginx—using OpenResty with Redis for millisecond response, fail2ban with log analysis for automated bans, and a pure‑shell file‑watch approach—each with step‑by‑step installation, configuration, and usage instructions.
This guide walks through constructing a high‑performance, cost‑effective enterprise‑level Web Application Firewall using OpenResty, covering why OpenResty is ideal, core architecture, modules for request lifecycle management, IP control, rate limiting, SQL injection and XSS detection, intelligent CC protection, monitoring, performance tuning, deployment tips, real‑world case study, and future enhancements.
This article explains how to evaluate system performance bottlenecks, choose between hard and soft rate‑limiting, and implement a non‑intrusive, high‑concurrency traffic‑control solution using OpenResty, Lua scripts, and Redis, covering architecture design, queue management, rate limiting, resource release, and performance testing.
This article walks through designing and implementing an enterprise‑grade API gateway with Nginx and OpenResty, covering architecture, dynamic routing, load balancing, rate limiting, circuit breaking, authentication, request transformation, caching strategies, observability, high‑availability deployment, and real‑world performance results.
This article analyzes current system performance bottlenecks, compares hard‑rate‑limiting and flexible queuing strategies, and presents a non‑intrusive traffic‑control solution built with OpenResty+Lua and Redis that offers zero‑code changes, high performance, scalability, and real‑time visual feedback for high‑concurrency scenarios.
This article explains how OpenResty, built on Nginx and Lua, can be used in production to implement interface authentication, traffic control, and request logging, detailing practical implementation steps, configuration examples, and code snippets that help improve service reliability and operational efficiency.
This article presents a hands‑on guide to using OpenResty—Lua‑enhanced Nginx—for implementing static and dynamic blacklists, fine‑grained rate limiting, A/B testing via upstream selection, and real‑time service quality monitoring, all with production‑ready code examples.
This article explains the role of an access gateway, outlines its architecture and core functions, and demonstrates how to design and implement a dynamic, plugin‑based gateway using OpenResty (Nginx + Lua), including routing, shared data, and dynamic upstream management.
This guide explains how to use the official 1panel‑migrator to upgrade a Linux server from 1Panel V1 to V2, covering prerequisites, installation of the migration binary, step‑by‑step service and website upgrades, important precautions, and post‑upgrade verification with example commands and logs.
This guide explains step‑by‑step how to set up a Web Application Firewall by installing LuaJIT, ngx_devel_kit, lua‑nginx‑module, compiling Nginx with Lua support, fixing common errors, and optionally using OpenResty, followed by configuring and testing the ngx_lua_waf module.
This guide explains how to use Nginx, Lua (via OpenResty), and Redis to automatically block any IP that exceeds 60 requests per minute, storing the blacklist in Redis with a default one‑day ban and providing performance optimizations and testing steps.
This article details how Ctrip's Soft Load Balancer (SLB) transitioned from a simple Nginx reverse‑proxy to a multi‑datacenter, dynamic routing gateway using OpenResty, Lua scripts, and a three‑layer architecture that eliminates reloads and supports high‑frequency configuration updates.
This guide walks through installing LuaJIT, ngx_devel_kit, and lua-nginx-module, compiling Nginx with Lua support, fixing common libluajit errors, optionally installing OpenResty, and configuring the ngx_lua_waf module to protect web applications.
This tutorial explains how to install LuaJIT, ngx_devel_kit, and lua‑nginx‑module, compile Nginx with Lua support, resolve common libluajit errors, optionally install OpenResty, and configure the ngx_lua_waf module to protect web applications.
This guide walks through installing LuaJIT, ngx_devel_kit, lua-nginx-module, compiling Nginx with Lua support, troubleshooting common errors, and adding a Lua-based Web Application Firewall (WAF) on an OpenResty platform.
This article provides an in‑depth overview of API gateway concepts, design principles, key features such as routing, load balancing, security, resilience, and compares popular gateway solutions like OpenResty, Kong, Zuul, and Spring Cloud Gateway for microservice architectures.
This article explains how to produce Lua‑level flame graphs for OpenResty by leveraging SystemTap’s lj‑lua‑stacks tool, demonstrates the underlying data structures and call‑stack extraction, and explores a possible eBPF‑based rewrite for safer, kernel‑level tracing.
This guide introduces the lightweight Lua‑resty‑template engine for OpenResty, explains its typical use cases, shows how to install and configure it, and provides step‑by‑step examples of basic and advanced template rendering with code snippets and configuration files.
This article introduces Nginx’s extensive built‑in variables, shows how to access them in OpenResty with ngx.var, and provides step‑by‑step Lua examples ranging from a simple arithmetic endpoint to a basic IP‑based firewall and rate‑limiting configuration.
This article explores the benefits of short URLs, explains their redirection mechanics, compares hash‑based and auto‑increment generation methods, and presents a high‑throughput architecture using OpenResty, Redis, and MySQL to handle massive traffic while ensuring reliability and scalability.
This guide walks you through setting up a local virtual domain for OpenResty, creating and editing configuration files, adding Lua location blocks, using external Lua script files, managing the lua_code_cache setting, and troubleshooting errors with practical command examples.
During flash‑sale events like JD or Taobao, a tiny fraction of products generate the majority of traffic, causing server overload; this guide explains how to identify and collect hotspot product data in real time using an OpenResty‑Lua front‑end, Kafka for messaging, and Elasticsearch for storage and analysis.
This article explains how to design a high‑QPS hotspot data caching and retrieval system for e‑commerce homepages using OpenResty, Lua, Redis, and a message queue, detailing publishing, reading processes, workflow diagrams, and a complete Lua script that can sustain tens of thousands to millions of concurrent requests.
The article describes a high‑throughput, fault‑tolerant data‑collection pipeline built with OpenResty, Lua, and Kafka that writes incoming records to disk using a cross‑worker mutex and cached file handles, rotates files via Nginx reload, and achieves over 13× performance versus typical online methods.
The article shows how OpenResty’s Lua‑based extensions can implement lightweight, version‑controlled API authentication, dynamic traffic‑shaping via shared‑memory peer status, and selective request tracing with batch‑sent logs to Elasticsearch, enabling secure, highly available services and rich observability without sacrificing Nginx performance in production.
This guide walks through selecting streaming protocols, preparing a high‑performance server, installing OpenResty, compiling the nginx‑ts module, configuring Nginx for RTMP/HLS/DASH, pushing streams with FFmpeg or OBS, and applying security and stability best practices.
This article explains the role of API gateways in microservice architectures, outlines their four core functions, discusses design priorities such as high performance, availability, and scalability, and compares major open‑source gateway solutions like OpenResty, Kong, Zuul, and Spring Cloud Gateway.
This article explains how Nginx evolved into the Kong API gateway through OpenResty, describes Kong’s plugin architecture and micro‑service‑oriented capabilities, and demonstrates setting up and managing Kong with Konga on Tencent Cloud, including monitoring, logging, and high‑availability features.
This article explains the role of API gateways, compares access‑layer and application‑layer designs, and provides a step‑by‑step guide to constructing a dynamic, high‑throughput gateway using OpenResty’s Nginx‑Lua architecture, plugin system, and runtime configuration features.
On July 13, 2021, Bilibili’s OpenResty‑based SLB suffered a CPU‑100% outage caused by a Lua _gcd function bug triggered when a service’s weight was set to the string “0”, leading to a multi‑hour incident that was resolved by rebuilding SLB clusters and disabling JIT compilation.
A detailed post‑mortem of the July 2021 Bilibili outage reveals how a Lua‑induced CPU spike in the OpenResty‑based SLB caused widespread service disruption, the step‑by‑step emergency response, root‑cause analysis, and the subsequent architectural and operational improvements to prevent recurrence.
In July 2021 a sudden CPU‑100% spike in Bilibili's OpenResty‑based SLB caused widespread service outages, prompting an emergency response that rebuilt load‑balancer clusters, traced a Lua _gcd function bug triggered by a zero weight string, and led to extensive operational and architectural improvements.
This article explains the fundamentals of API gateways, their role in microservice architectures, key design considerations such as routing, load balancing, security, and elasticity, and compares major open‑source implementations like OpenResty, Kong, Zuul, and Spring Cloud Gateway.
This guide explains how to use OpenResty’s Lua capabilities to replace Tomcat‑based Redis access with direct Nginx‑Redis integration, apply compression to reduce bandwidth, set up periodic cache refreshes, configure single‑worker timers, and manage cache settings via a signed backend API.
The article benchmarks cjson, rapidjson, and yyjson JSON libraries on a 6‑core OpenResty setup, shows that combining rapidjson's encode with yyjson's decode reduces 500,000 mixed encode/decode operations to 11 seconds, and describes a Lua wrapper that adds schema validation and improves maintainability.
This article explains how to use OpenResty with Lua to integrate Redis directly into Nginx for cache‑driven request forwarding, data compression, timed updates, single‑process scheduling, and configurable URL caching, thereby improving concurrency, reducing latency, and enhancing backend resilience.
This article introduces the APISIX API gateway, explaining its cloud‑native architecture built on OpenResty and Etcd, the advantages over traditional monolithic service frameworks, detailed feature breakdowns, performance benchmark comparisons with OpenResty, multi‑cluster management practices, usage scenarios, monitoring, logging, and future development directions.
This article explains how to use OpenResty and Lua to integrate Redis caching, compress responses, schedule periodic updates, and configure URL‑based cache rules directly within Nginx, improving concurrency and resilience of web services.
Learn how to leverage OpenResty and Lua to replace traditional Tomcat‑Redis pipelines with direct Nginx caching, compress responses, schedule periodic updates, and configure dynamic URL caching, dramatically reducing latency and improving concurrency for high‑traffic web services.
This article explains how to leverage OpenResty and Lua scripts to integrate Nginx with Redis for direct caching, compression, timed updates, request forwarding, and configurable URL management, thereby improving concurrency, reducing latency, and enhancing the resilience of backend web services.
This article details the architecture of the Qingzhou Business Gateway, identifies its granular control, data‑loss, and performance issues, and explains a series of optimizations—including FFI usage, table‑pool reuse, coroutine caching, radixtree routing, and connection‑pool tuning—that raise single‑node QPS to 80 k while preserving functional capabilities.
This guide explains how to use OpenResty’s Lua modules to let Nginx read and write Redis directly, compress large payloads, schedule periodic cache updates, and configure URL‑based caching, thereby reducing latency, saving bandwidth, and improving overall backend reliability.
This article explains how to use OpenResty with Lua to integrate Nginx and Redis for high‑performance caching, data compression, timed updates, and configurable URL management, enabling resilient backend services that continue serving content even when application servers fail.
The article explains how a senior architect uses OpenResty and Lua to let Nginx directly access Redis for caching, compresses large responses, schedules periodic updates, and provides a configurable, signature‑verified caching layer to improve web performance and resilience.
This article explains DataVisor's risk‑control system architecture, outlines the business challenges such as complex logic, massive data, high QPS and low latency, and demonstrates how OpenResty (Nginx + Lua) is used for high‑performance gateways, micro‑service style calls, hot‑loaded scripts, automatic circuit‑breakers, and progressive architectural evolution toward service‑mesh designs.
This article explains how to use OpenResty with Lua to build a high‑performance caching layer that directly accesses Redis, compresses large responses, schedules periodic updates, forwards requests intelligently, and provides configurable URL caching, thereby improving concurrency, reducing latency, and optimizing bandwidth usage.
This article explains the benefits of short URLs and presents a comprehensive, interview‑friendly design for a high‑performance short‑link service, covering redirect mechanics, hash‑based and auto‑increment generation methods, database schema, collision handling, and an OpenResty‑based architecture for massive concurrency.
This article explains how to design and implement a secure gRPC gateway using OpenResty, analyzes performance bottlenecks such as excessive TIME_WAIT connections, and provides practical kernel and Nginx/OpenResty tuning steps to achieve long‑lived connections and lower latency.
Learn how Linux’s non‑blocking I/O mechanisms such as select, poll, and epoll enable high‑concurrency servers, explore OpenResty’s Lua‑based architecture, and follow step‑by‑step instructions for installing, configuring, and troubleshooting a performant OpenResty/Nginx environment on Linux.
This guide explains Linux socket programming techniques such as non‑blocking I/O and epoll, introduces the OpenResty platform built on Nginx and Lua, and provides step‑by‑step instructions for installing, configuring, and optimizing high‑concurrency web services with code examples.
This article provides a comprehensive guide to the open‑source Kong API gateway, covering its architecture built on OpenResty, step‑by‑step installation on CentOS, core components, key features, plugin ecosystem, authentication, traffic control, logging, and a comparison with other gateways, while also showing how to set up the Kong Dashboard UI.
This guide explains how Linux socket I/O multiplexing (select, poll, epoll) powers high‑concurrency servers, why caching and asynchronous non‑blocking are crucial, and provides step‑by‑step instructions to install, configure, and develop with OpenResty, Nginx, and Lua for scalable backend applications.
This article examines the challenges of microservice communication and explains how to transform an Nginx+Lua layer into an OpenResty‑based API gateway, covering core concepts, usage scenarios, security, performance, high‑availability, extensibility, and a comparative review of popular open‑source gateway solutions such as Nginx, Spring Cloud Zuul, Kong, Tyk and others.
This tutorial walks through installing OpenResty, creating a simple hello‑world service, and implementing a practical Lua‑based request routing example that distinguishes single‑ versus multiple‑UID POST bodies, complete with Nginx configuration, Go backend code, and testing steps.
This article explains Linux socket programming techniques such as non‑blocking I/O and epoll, discusses caching and asynchronous design for high‑performance servers, and provides a step‑by‑step guide to installing, configuring, and developing with OpenResty (Nginx + Lua) on Linux and Windows environments.
This guide explains how to use Linux non‑blocking socket APIs (select, poll, epoll) and the OpenResty platform (Nginx + LuaJIT) to create scalable, high‑concurrency web services, covering architecture, caching strategies, and step‑by‑step installation and configuration.
This article presents a comprehensive design of a flash‑sale (seckill) system for an automotive e‑commerce platform, covering business requirements, model selection, stock‑deduction strategies, high‑performance and high‑availability architecture, security mechanisms, and future optimization directions, all built on cloud‑native backend technologies.
This article explains the role of an access‑layer gateway, presents its architecture and implementation using OpenResty, discusses technical selection, details OpenResty’s underlying Nginx/Lua mechanisms, and shows how to achieve dynamic routing, plugin‑based policies, shared data, and upstream configuration without service reloads.
This guide walks you through installing OpenResty—a high‑performance Nginx/Lua web platform—on CentOS, adding a ready‑made Lua WAF module, configuring its various security rules (IP blacklist/whitelist, CC protection, URL, User‑Agent, GET/POST filters), and troubleshooting common issues.
This guide explains Linux socket programming concepts such as non‑blocking I/O and epoll, introduces the OpenResty web platform built on Nginx and Lua, walks through environment setup, configuration, Lua scripting, and common troubleshooting steps for building high‑concurrency backend services.
This tutorial shows how to use the open‑source APISIX API gateway—built on OpenResty and etcd—to create a dynamic rate‑limiting plugin in Lua, configure route matching with a radix tree, and demonstrate the feature with a test endpoint that enforces one request per second and returns HTTP 503 when exceeded.
This article explores the design of a high‑performance short‑link system, covering its benefits, redirection mechanics, hash‑based and auto‑increment generation methods, database schema, Bloom filter optimization, and a scalable OpenResty‑based architecture for handling massive traffic.
Zhihu’s infrastructure team designed a high‑performance, scalable long‑connection gateway that decouples business logic via publish‑subscribe, leverages OpenResty, Kafka, and Redis, implements fine‑grained ACL, sliding‑window flow control, and ensures message reliability and horizontal scalability for millions of concurrent devices.
This article explains what OpenResty is, details its underlying Nginx‑Lua architecture—including Lua coroutines, cosocket, and multi‑stage processing—compares its performance with other web platforms, and describes its practical deployment and multi‑level caching strategy in JD.com's high‑traffic Jshop sale system.
This article details the architectural redesign, fault‑tolerance mechanisms, performance optimizations, and monitoring strategies employed in JD.com’s PC homepage, illustrating how backend technologies such as OpenResty, Lua, Redis, and NGINX are orchestrated to achieve high availability and sub‑30 ms page loads.
This article details the design and implementation of a Kubernetes‑native API Gateway built with OpenResty, covering its architecture, controller logic, HTTP/gRPC load balancing, custom ingress handling, rate‑limiting, service proxying, and future plans for service‑mesh integration.
This article details the design and implementation of ADMonitor, a high‑availability, low‑latency advertising monitoring platform built on OpenResty, covering its architecture, data collection, processing, archiving, and performance outcomes.
This guide introduces APISIX, a high‑performance, extensible microservice API gateway built on Nginx and etcd, outlines its key features, and provides step‑by‑step instructions for installing OpenResty, etcd, launching APISIX, and testing rate‑limiting capabilities.
This article demonstrates how OpenResty can be used in production to implement static and dynamic blacklists, request rate limiting, AB testing, and service quality monitoring by embedding Lua scripts into Nginx, with detailed configuration examples and code snippets.
The article details the step‑by‑step architectural evolution of Mafengwo's instant‑messaging platform—from an initial PHP‑based monolith, through polling optimizations with OpenResty, to a Go‑implemented, micro‑service‑oriented design that improves scalability, reliability, and multi‑device synchronization.
This article examines three OpenResty-based backend health‑check solutions—ngx_http_upstream_module, lua‑resty‑upstream‑healthcheck, and nginx_upstream_check_module—detailing their implementation principles, configuration examples, node status monitoring, and practical Docker integration, helping developers choose the optimal approach for reliable service availability.
This article chronicles the evolution of MaFengWo's instant‑messaging platform, detailing the transition from a simple PHP implementation to OpenResty optimizations, the introduction of multi‑mode routing in IM 2.0, and a complete service‑oriented redesign in Go for IM 3.0, while addressing scalability, multi‑device synchronization, and message reliability.
This article explains how Zhihu designed a scalable long‑connection gateway that decouples business logic via a publish‑subscribe model, implements ACL‑based authorization, ensures message reliability with acknowledgments and sliding windows, and leverages OpenResty, Redis, and Kafka for load‑balanced, fault‑tolerant backend services.
This article explains how MaFengWo built a data‑driven AB testing platform using OpenResty, MurmurHash, and a three‑tier cache to achieve low‑latency, high‑throughput traffic splitting across web, app, and micro‑service environments.
This article explores the motivations, core concepts, usage scenarios, design considerations, and popular open‑source implementations of API gateways, offering practical guidance for building high‑performance, secure, and scalable gateway layers in microservice architectures.
This article explains how OpenResty, built on Nginx and Lua, powers JD Logistics' high‑throughput, extensible gateway by leveraging non‑blocking I/O, plugin architecture, multi‑level caching, dynamic load balancing, and custom JSON handling to achieve stable, scalable performance.
This guide introduces Lua’s concise syntax, tiny footprint, and performance strengths, explores typical use cases such as security, web APIs, and game servers, then walks through core language features, OpenResty integration, deployment steps, and a hands‑on exercise for building a redirect service.
This article explains Kong’s architecture, core components, key features, plugin ecosystem, request processing flow, and limitations, showing how it provides a high‑availability, horizontally‑scalable API gateway built on OpenResty for modern backend services.
This guide compiles resources and key concepts on OpenResty, Lua‑based Nginx development, asynchronous programming models, microservice API gateways, and related plugins, providing a structured roadmap for backend engineers to deepen their understanding and practical skills.
This article explains why rate limiting is essential for flash‑sale (seckill) systems, compares token‑bucket and leaky‑bucket algorithms, and provides concrete Tomcat, Nginx, OpenResty, and Guava configurations along with code snippets and load‑testing results to help engineers implement robust throttling.
This article explains why rate limiting is essential for flash‑sale (seckill) services, compares token‑bucket and leaky‑bucket algorithms, and provides practical configuration examples for Tomcat, Nginx, and OpenResty, along with testing methods and code snippets.
This article explains why high‑traffic scenarios like flash‑sale systems need rate limiting, compares token‑bucket and leaky‑bucket algorithms, and shows practical configurations for Tomcat, Nginx, and OpenResty to protect APIs and ensure system stability.
The article explains how an API gateway serves as a unified, secure entry point for services, outlines the limitations of manual NGINX configurations, and describes a practical implementation using OpenResty/Nginx with the open‑source Orange framework—enhanced with dynamic routing, header‑based authentication, encryption, and high‑availability design, dubbed the Aegis gateway.
This article explains the role of API gateways in microservice systems, discusses challenges of aggregating data across services, compares single‑node and BFF gateway patterns, evaluates open‑source gateway projects, and proposes a double‑gateway solution for high‑performance, scalable backend integration.
This article explains microservice architecture versus monolithic design, discusses communication, service discovery, ordering, and messaging strategies, and details GeTui’s practical implementation using OpenResty, API gateways, Zookeeper, and DevOps automation.
This article examines the architecture of Weibo's high‑availability advertising platform, covering match service design with OpenResty, index sharding, business logic optimization, dynamic auto‑scaling, and a real‑time monitoring pipeline to ensure stable, high‑performance ad delivery at massive scale.
This article explains the evolution from LAMP to LNMP, details how Nginx interacts with PHP‑FPM via CGI/FastCGI, compares Nginx and Apache processing models, and introduces LORMP (OpenResty + Lua) with configuration and code examples for building high‑performance backend web services.
This article examines how JD’s activity system evolved its web architecture—introducing full‑page Redis and disk caching, asynchronous rendering, and OpenResty—resulting in a latency drop from around 1000 ms to under 15 ms and dramatically lower CPU usage.
This article explains how to implement access‑layer rate limiting in Nginx using built‑in modules, OpenResty Lua extensions, and token‑bucket or leaky‑bucket algorithms, with detailed configuration snippets, execution flow, testing procedures, and log analysis for robust traffic control.
This article introduces the advantages of Nginx and Lua, explains the ngx_lua module and OpenResty ecosystem, describes common architectural patterns such as load balancing and caching, and provides a step‑by‑step guide to building, configuring, and deploying a Lua‑based web application on Nginx.