NGINX
HTTP and reverse proxy server, mail proxy server, and generic TCP/UDP proxy server.
Alternatives
Tech stack
No tech stack added yet. Sign in to suggest some
Introduction
NGINX (pronounced "engine x") is an HTTP web server that also works as a reverse proxy, content cache, load balancer, TCP/UDP proxy server and mail proxy server. It was originally written by Igor Sysoev and is released under the 2-clause BSD license. NGINX is flexible to configure, high-performing and light on resources. According to Netcraft, it is one of the most widely used web servers in the world. Its Docker image has also consistently ranked among the most popular. Several Kubernetes Ingress Controllers are built on NGINX, including the official Ingress Controller. F5 offers an enterprise distribution, commercial support and training.
Key Features
Basic HTTP Serving
- Serves static files and index files, with automatic directory listings and open file descriptor caching
- Accelerated reverse proxy with caching, load balancing and fault tolerance
- Supports FastCGI, uwsgi, SCGI and memcached backends, with acceleration and caching
- Modular architecture, with filters including gzip compression, byte ranges, chunked responses, XSLT, SSI and image transformation
- Supports SSL/TLS SNI, HTTP/2 and HTTP/3
Other HTTP Features
- Name-based and IP-based virtual hosts
- Supports keep-alive and pipelined connections
- Customizable access log formats, with buffered writes, fast log rotation and syslog
- URI rewriting with regular expressions (rewrite module); customizable redirects for 3xx-5xx error pages
- Access control by client IP, HTTP Basic authentication or subrequest result
- HTTP Referer validation, plus WebDAV methods (PUT, DELETE, MKCOL, COPY, MOVE)
- FLV and MP4 streaming
- Response rate limiting, plus limits on concurrent connections and requests per address
- IP geolocation, A/B testing, request mirroring
- Embedded Perl, and extensibility through the njs scripting language (a JavaScript subset)
Mail Proxy
- Redirects users to an IMAP/POP3 server, or forwards them to an internal SMTP server, through an external HTTP authentication server
- Supports authentication methods such as USER/PASS, APOP and AUTH LOGIN/PLAIN/CRAM-MD5
- Supports SSL, STARTTLS and STLS
TCP/UDP Proxy (stream)
- General-purpose TCP and UDP proxying
- SSL and TLS SNI support for TCP
- Load balancing and fault tolerance
- Address-based access control and connection limits
- Logging, geolocation, A/B testing and njs scripting
Architecture and Performance
- One master process plus multiple worker processes, with workers running as an unprivileged user
- Reloads configuration and upgrades the executable without interrupting clients being served
- Supports event mechanisms such as epoll, kqueue, /dev/poll, event ports, select and poll
- Supports efficient I/O features such as sendfile, file AIO and DIRECTIO, and minimizes data copying
- 10,000 idle HTTP keep-alive connections use only about 2.5 MB of memory
Target Users and Use Cases
Suited to operations engineers, backend developers, webmasters and self-hosting enthusiasts. It can be used to host websites, act as a reverse proxy and load balancer in front of applications, provide Ingress for Kubernetes, or serve as a unified entry gateway for a home server.
Installation and Deployment
- Get the source code or prebuilt packages from the official download page, which offers two branches: mainline and stable
- Most Linux distributions let you install it directly with the package manager, for example
apt install nginxordnf install nginx - Deploy with Docker:
docker run -d -p 80:80 nginx - On Kubernetes, you can use the NGINX Ingress Controller or NGINX Gateway Fabric
Supported Platforms
Officially tested platforms include FreeBSD, Linux (i386, amd64, ARM, aarch64, ppc64le, s390x), Solaris, AIX, HP-UX, macOS and Windows (XP through Windows 11).
Worth Noting
- The open-source version uses the permissive BSD license, so it can be used safely in commercial settings
- Configuration files use a declarative syntax, and the community offers plenty of documentation and tutorials
- If you need enterprise features and commercial support, you can choose the commercial products from F5
Discover more
Apache HTTP Server
Secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.
HAProxy
Very fast and reliable reverse-proxy offering high availability, load balancing, and proxying for TCP and HTTP-based applications.
Lighttpd
Secure, fast, compliant, and very flexible web server that has been optimized for high-performance environments.
BunkerWeb
Next-gen Web Application Firewall (WAF) that will protect your web services.
Caddy
Powerful, enterprise-ready, open source web server with automatic HTTPS.
Varnish
Web application accelerator/caching HTTP reverse proxy.