How to Choose and Manage Nginx Modules and Process Modes
This guide explains how Nginx modules are organized, how to view and select available modules with ./configure --help, add third‑party modules using the --add-module option, and understand Nginx’s single‑process and master‑worker process models.
Introduction
Nginx, like Apache, uses a modular architecture, but unlike Apache’s hot‑plug approach, adding or removing a module in Nginx requires recompilation.
Selecting Applicable Nginx Modules
In the Nginx (1.8.0) directory, run ./configure --help to list installed modules:
In the output, --with-XXX indicates a module that can be enabled, while --without-XXX indicates a module that is disabled by default. Modules listed with --without-XXX are included in the default build; those with --with-XXX are not compiled unless explicitly requested. If both flags appear for a module, the build system decides based on the system environment.
Installing Third‑Party Nginx Modules
When configuring Nginx, the --add-module option is used to include third‑party modules. For example:
--add-module=/root/nginx-accesskey-2.0.3
This adds a hot‑link protection module.
Nginx Process Management
Nginx operates in two process modes: Single and Master. Single mode runs a single process via ngx_single_process_cycle. Master mode consists of one master process and multiple worker processes, which is the typical deployment model.
On Linux kernels 2.6 and newer, Nginx uses the epoll event model, which efficiently handles large numbers of simultaneous connections.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Backend Technology
Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
