Configure a web server, load balancer, and reverse proxy in one open-source tool
It handles the process of distributing requests to prevent server crashes, delivering frequently used data quickly, and setting up secure connections within a single program. NGINX is free open-source software that performs these roles and can be adapted to various network environments by modifying text-based configuration files. You can combine the necessary functions among web server, reverse proxy, load balancer, API gateway, and content cache by adjusting directives in the configuration file, without writing complex network structures directly in code.
Process structure and module-based extension
NGINX operates with a structure where a master process and worker processes work together, rather than as a single process. The master process reads the configuration file and manages the worker processes, while the worker processes handle actual data processing such as HTTP requests. The number of worker processes can be fixed in the configuration file or automatically adjusted according to the number of CPU cores, allowing for efficient distribution of system resources. Features are composed in module units and can be included statically at build time or added dynamically after execution. Running the nginx -V command allows you to check which static modules are included in the current binary.
Installation paths and version selection
Most Linux distributions include the community version of NGINX by default, but using the official packages from this repository is recommended to receive the latest features and security patches. Binaries are distributed in two versions: 'Stable' and 'Mainline'. The Stable version is built from the stable branch and includes only major fixes, while the Mainline version is built from the master branch and includes the latest features and bug fixes. On Linux, you install by adding the official repository to the package manager of the respective distribution, and subsequent upgrades can also be managed with the same manager. The Windows executable is currently at the proof-of-concept stage, so it should be used only for development and testing purposes.
Source code build process
To build directly from source, you must first install dependency libraries such as gcc, make, libpcre3-dev, and zlib1g-dev. If you plan to use TLS encryption, you must also additionally install libssl-dev.
Pre-application checks
NGINX is free open-source software distributed under a 2-clause BSD-like license. Enterprise distributions, commercial support, and training are provided by F5, Inc. The README in this repository is intended as a basic introduction for beginners, and detailed information on installation, building, configuration, and debugging should be referenced in the official documentation's Beginners Guide or How-Tos. In particular, note that in Windows environments, usage is limited to development and testing purposes only, not for production. When using specific modules, it is necessary to check whether the version includes that module or whether it can be loaded as a dynamic module.