Easily compile and install NGINX from source with custom features, modules, and patches.
- Debian 9 and later
 - Ubuntu 16.04 and later
 
- Compile the latest mainline or stable NGINX from source.
 - Integrate optional modules and patches.
 - Use a custom nginx.conf for enhanced performance.
 - Include a systemd init script (not provided by default).
 - Configure logrotate for efficient log management.
 - Block APT-based NGINX installations to avoid conflicts.
 
- LibreSSL or OpenSSL from Source: Enable cutting-edge TLS features like HTTP/2, CHACHA20, and TLS 1.3.
 - Cloudflare Patches: Add HTTP/3, TLS Dynamic Record Resizing, and HPACK encoding.
 - Performance Modules: Integrate ngx_pagespeed for optimization and ngx_brotli for Brotli compression.
 - Security Enhancements: Use ModSecurity for WAF, testcookie-nginx-module for bot protection, and nginx-ultimate-bad-bot-blocker for blocking malicious traffic.
 - Cache Modules: Incorporate Redis-based caching with redis2-nginx-module and ngx_http_redis.
 - Additional Modules: Extend functionality with lua-nginx-module, RTMP module for streaming, and more.
 
Download and execute the script to:
- Install or update NGINX
 - Uninstall with optional cleanup
 - Self-update the script
 
wget https://raw.githubusercontent.com/AnonVM/Nginx-Installer/main/setup.sh
chmod +x setup.sh
./setup.shCheck out configuration examples for custom modules.
For automated installations, run the script in headless mode by setting HEADLESS=y.
HEADLESS=y ./setup.shExample commands:
- Install NGINX with Brotli:
HEADLESS=y NGINX_VER=MAINLINE BROTLI=y ./setup.sh
 - Install with GeoIP:
HEADLESS=y GEOIP=y GEOIP2_ACCOUNT_ID=YOUR_ACCOUNT_ID_HERE GEOIP2_LICENSE_KEY=YOUR_LICENSE_KEY_HERE ./setup.sh
 - Uninstall with Cleanup:
HEADLESS=y OPTION=2 RM_CONF=y RM_LOGS=y ./setup.sh