Nginx Web Server

Fully optimized Nginx with HTTP/2, HTTP/3 QUIC, Brotli compression, Lua scripting, and 20+ modules compiled in.

Table of Contents

Current Default: Nginx 1.29.6

Default across all branches (132.00stable, 140.00beta01, 141.00beta01). Compiled from source with OpenSSL 1.1.1w and Cloudflare-optimized zlib.

HTTP/2 & HTTP/3 QUIC Support

Centmin Mod Nginx is compiled with full HTTP/2 support enabled by default, including HPACK encoding for header compression. HTTP/3 QUIC support is available as an optional feature.

HTTP/3 QUIC Options

For HTTP/3 QUIC support, Centmin Mod provides three SSL library choices:

  • quicTLS — OpenSSL 1.1.1w+quic fork (default QUIC option)
  • BoringSSL — Google’s fork of OpenSSL (BORINGSSL_SWITCH='y')
  • AWS-LC — Amazon’s cryptographic library (AWS_LC_SWITCH='y')

Enable HTTP/3 QUIC in /etc/centminmod/custom_config.inc:

custom_config.inc
NGINX_QUIC_SUPPORT='y'

Note

AWS-LC takes priority over quicTLS when both are enabled. The OpenResty set-misc module is not compatible with BoringSSL builds.

Enabled Modules (Default)

These modules are compiled and enabled by default in every Centmin Mod Nginx build:

Module Type Description
http_v2_moduleStaticHTTP/2 protocol with HPACK encoding
http_ssl_moduleStaticHTTPS/TLS support
http_realip_moduleStaticReal IP detection behind proxies/CDN
http_stub_status_moduleStaticServer statistics and monitoring
http_sub_moduleStaticResponse body string substitution
http_addition_moduleStaticAppend/prepend text to responses
http_gzip_static_moduleStaticPre-compressed static file serving
ngx_cache_purgeStaticFastCGI/proxy cache purge support
ngx_http_redisStaticRedis protocol support for caching
ngx_fancyindexDynamicFancy directory listing
headers-moreDynamicSet/clear input and output headers
ngx_brotliDynamicBrotli compression (on-the-fly & static)
ngx_image_filterDynamicOn-the-fly image resizing/cropping
set-misc-nginxDynamicExtended set directives (base64, hashing)
echo-nginxDynamicShell-style echo/sleep/time in configs
lua-nginx-moduleDynamicOpenResty Lua scripting engine
ngx_devel_kitDynamicDevelopment kit for 3rd-party modules
GeoIP (legacy)StaticMaxMind GeoIP country/city lookups
http_secure_link_moduleStaticURL verification via hashed links
stream_moduleStaticTCP/UDP proxy and load balancing (with stream_ssl)
stream_ssl_preread_moduleStaticSSL/TLS info extraction without terminating

Disabled/Optional Modules

These modules can be enabled via /etc/centminmod/custom_config.inc before running a Nginx upgrade (Menu 4):

Module Variable Description
PageSpeed (Deprecated)NGINX_PAGESPEED='y'Google PageSpeed optimization module (Deprecated — no longer supported)
WebDAVNGINX_WEBDAV='y'WebDAV protocol support
RTMPNGINX_RTMP='y'RTMP live streaming
njsNGXDYNAMIC_NJS='y'Nginx JavaScript scripting
GeoIP2NGINX_GEOIPTWOLITE='y'MaxMind GeoIP2 Lite database support
ModSecurityNGINX_MODSECURITY='y'Web application firewall (WAF)
VTSNGINX_VHOSTSTATS='y'Virtual host traffic status monitoring
testcookieNGXDYNAMIC_TESTCOOKIE='y'Bot detection via test cookie
HTTP ConcatNGINX_HTTPCONCAT='y'Concatenate CSS/JS files (Alibaba)
srcacheNGXDYNAMIC_SRCCACHE='y'Transparent subrequest-based caching
memc-nginxNGXDYNAMIC_MEMC='y'Extended Memcached interface
redis2NGXDYNAMIC_REDISTWO='y'Full Redis 2.0 protocol support
zstdNGXDYNAMIC_ZSTD='y'Zstandard compression
http_auth_requestNGINX_AUTHREQ='y'Subrequest-based client authorization
nginx-length-hidingNGINX_LENGTHHIDE='y'BREACH attack mitigation
XSLTNGINX_XSLT='y'XML/XSLT response transformations
PerlNGINX_PERL='y'Embedded Perl scripting
FLVNGINX_FLV='y'Flash Video pseudo-streaming
MP4NGINX_MP4='y'MP4 pseudo-streaming with seek
SliceNGINX_SLICE='y'Split large responses for caching
PassengerNGINX_PASSENGER='y'Phusion Passenger app server

OpenResty Lua Module

Centmin Mod includes the OpenResty Lua Nginx module as a dynamic module (NGINX_OPENRESTY='y'). This embeds LuaJIT into Nginx for high-performance scripting directly in your Nginx configuration.

Companion OpenResty modules included:

  • set-misc-nginx-module — Extended set directives (base64, hashing, random)
  • echo-nginx-module — Shell-style echo, sleep, time in configs
  • ngx_devel_kit — Development kit for third-party modules

Dynamic modules are loaded in /usr/local/nginx/conf/dynamic-modules.conf and can be individually enabled or disabled.

Brotli Compression

Brotli compression is compiled as a dynamic module (NGXDYNAMIC_BROTLI='y') and provides 15-25% better compression than gzip for text-based content. It supports both on-the-fly compression and serving pre-compressed .br files.

HTTP Concat Module

The nginx-http-concat module (by Alibaba) concatenates multiple CSS or JavaScript files into a single response, reducing HTTP requests. It is disabled by default.

Enable it with NGINX_HTTPCONCAT='y' in /etc/centminmod/custom_config.inc and run Menu 4 to recompile.

Usage Example

Request multiple files in one URL:

URL format
https://example.com/??style1.css,style2.css,style3.css

Nginx Upgrade / Downgrade (Menu 4)

Use centmin.sh menu option 4 to upgrade or downgrade Nginx to any version. This recompiles Nginx from source with all your configured modules.

Terminal
# Set desired version in custom_config.inc first NGINX_VERSION='1.29.6' # Then run centmin.sh and select option 4 centmin.sh
Terminal — Menu 4 Interactive Session
-------------------------------------------------------- Centmin Mod Menu 141.00beta01 centminmod.com -------------------------------------------------------- 1). Centmin Install 2). Add Nginx vhost domain 3). NSD setup domain name DNS 4). Nginx Upgrade / Downgrade 5). PHP Upgrade / Downgrade 6). MySQL User Database Management 7). Persistent Config File Management 8). PostgreSQL Server Management 9). Option Being Revised (TBA) 10). Memcached Server Re-install 11). MariaDB MySQL Upgrade & Management 12). Zend OpCache Install/Re-install 13). Install/Reinstall Redis PHP Extension 14). SELinux disable 15). Install/Reinstall ImagicK PHP Extension 16). Change SSHD Port Number 17). Multi-thread compression: zstd,pigz,pbzip2,lbzip2 18). Suhosin PHP Extension install 19). Install FFMPEG and FFMPEG PHP Extension 20). NSD Install/Re-Install 21). Data Transfer 22). Add Wordpress Nginx vhost + Cache Plugin 23). Update Centmin Mod Code Base 24). Exit -------------------------------------------------------- Enter option [ 1 - 24 ] 4 -------------------------------------------------------- ********************************************************************** * Nginx Update script - Included in Centmin Extras * Version: 141.00beta01.b161 - Date: 16/08/25 - Copyright 2011-2025 CentminMod.com ********************************************************************** This software comes with no warranty of any kind. You are free to use it for both personal and commercial use as licensed under the GPL. Nginx Upgrade - Would you like to continue? [y/n] y Current Nginx Version: 1.29.6 (100326-200708-almalinux10-virtualbox-kvm-673b155) Install which version of Nginx? (version i.e. type 1.29.6): 1.29.6 Do you still want to continue? [y/n] y

Editing Configs the Right Way

Always set configuration variables in /etc/centminmod/custom_config.inc (shortcut: customconfig) rather than editing centmin.sh directly. This persists your settings across Centmin Mod updates.

Auto-Backup on Upgrade

Before each Nginx upgrade, Centmin Mod automatically backs up your Nginx directory to /usr/local/nginxbackup. This allows you to restore your previous Nginx installation if needed.

Persistent Config File Management (Menu 7)

Menu option 7 manages persistent configuration files. Additionally, the Nginx VTS (Virtual Host Traffic Status) module can be optionally enabled to provide real-time traffic statistics per virtual host including request counts, response times, and bandwidth usage.

Enable VTS with NGINX_VHOSTSTATS='y' and recompile via Menu 4.

Access & Error Logs

Nginx log files are located at:

  • /var/log/nginx/access.log — Main access log
  • /var/log/nginx/error.log — Main error log
  • /home/nginx/domains/domain.com/log/access.log — Per-vhost access log
  • /home/nginx/domains/domain.com/log/error.log — Per-vhost error log

Log rotation is handled automatically via logrotate with daily rotation and 10 days of retention.

Configuration Error Checking

Always test your Nginx configuration before reloading:

Terminal
# Test configuration syntax nginx -t # Reload after successful test ngxreload # Or restart ngxrestart

Adding/Enabling Modules

To enable or disable Nginx modules:

  1. Edit /etc/centminmod/custom_config.inc
  2. Set the module variable to 'y' (enable) or 'n' (disable)
  3. Run centmin.sh menu option 4 to recompile Nginx
custom_config.inc
# Example: Enable ModSecurity WAF and HTTP/3 QUIC NGINX_MODSECURITY='y' NGINX_QUIC_SUPPORT='y' # Example: Enable GeoIP2 Lite NGINX_GEOIPTWOLITE='y'

Key Configuration Files

Path Description
/usr/local/nginx/conf/nginx.confMain Nginx configuration
/usr/local/nginx/conf/conf.d/Virtual host configuration files
/usr/local/nginx/conf/dynamic-modules.confDynamic module loading directives
/usr/local/nginx/conf/phpfpmd/PHP-FPM upstream configurations
/etc/centminmod/custom_config.incPersistent custom settings (survives updates)
/usr/local/nginx/modules/Dynamic module .so files

Need help?

Join the community forums for Nginx configuration help and optimization tips.