Servers and cloud
Linux distributions for servers
Server distributions like Ubuntu, Debian, RHEL, CentOS Stream, Rocky Linux, Oracle Linux and Amazon Linux vary by support length and release model.
· Mateo Cardenas
nginx is an HTTP web server, reverse proxy, content cache, load balancer, TCP/UDP proxy server and mail proxy server.1, source 1 The name nginx is rendered as "engine x".1, source 1 It was originally written by Igor Sysoev and is distributed under the 2-clause BSD License.1, source 1
nginx started out as a web server designed for maximum performance and stability.2, source 2 It is open source software, and media streaming is among the jobs it can handle.2, source 2 nginx is frequently set up as a proxy server, which receives requests, passes them to the proxied servers, retrieves responses from them, and sends them to the clients.3, source 3
nginx describes itself as known for flexibility and high performance with low resource utilization, and as powering multiple Ingress Controllers for Kubernetes.1, source 1 Enterprise distributions, commercial support and training for nginx are available from F5, Inc.1, source 1 NGINX is a registered trademark of F5, Inc.2, source 2
nginx has one master process and several worker processes.3, source 3 The main purpose of the master process is to read and evaluate configuration, and maintain worker processes.3, source 3 Worker processes do the actual processing of requests.3, source 3 nginx employs an event-based model and OS-dependent mechanisms to efficiently distribute requests among worker processes.3, source 3
The number of worker processes is defined in the configuration file and may be fixed for a given configuration or automatically adjusted to the number of available CPU cores.3, source 3 nginx worker processes run under an unprivileged user.1, source 1 nginx can be reconfigured and its executable upgraded without interrupting the servicing of clients.1, source 1
nginx supports a variety of connection processing methods.4, source 4 The availability of a particular connection processing method depends on the platform used.4, source 4 On platforms that support several methods, nginx will normally select the most efficient method automatically.4, source 4 A connection processing method can be selected explicitly with the use directive.4, source 4
nginx supports the kqueue method (FreeBSD 4.1+) and the epoll method (Linux 2.6+), among others.1, source 1 nginx states that 10,000 inactive HTTP keep-alive connections take about 2.5M memory.1, source 1
Serving out files, such as images or static HTML pages, is an important web server task.3, source 3 nginx can serve static and index files and can autoindex directories.1, source 1 In a simple setup that serves files from local directories, nginx sends a response indicating the 404 error when the requested file does not exist.3, source 3 nginx filters include gzipping, byte ranges, chunked responses, XSLT, SSI and an image transformation filter.1, source 1
nginx supports HTTP/2 with weighted and dependency-based prioritization, and it supports HTTP/3.1, source 1 Virtual servers in nginx can be name-based or IP-based.1, source 1
nginx can restrict access by client IP address and by password using HTTP Basic authentication.1, source 1 It can also limit the number of simultaneous connections or requests coming from one address.1, source 1 Logging options include access log formats, buffered log writing, fast log rotation and syslog logging.1, source 1
nginx can route requests to FastCGI servers, which run applications built with various frameworks and programming languages such as PHP.3, source 3 The most basic nginx configuration to work with a FastCGI server uses the fastcgi_pass directive instead of the proxy_pass directive, and fastcgi_param directives to set parameters passed to the FastCGI server.3, source 3
nginx supports accelerated reverse proxying with caching.1, source 1 In a basic nginx proxy configuration, the proxy_pass directive takes the protocol, name and port of the proxied server as its parameter.3, source 3 Load balancing across multiple application instances is a commonly used technique for optimizing resource utilization, maximizing throughput, reducing latency, and ensuring fault-tolerant configurations.5, source 5 When the load balancing method is not specifically configured in nginx, it defaults to round-robin.5, source 5
nginx reverse proxy load balancing covers HTTP, HTTPS, FastCGI, uwsgi, SCGI, memcached and gRPC.5, source 5 Least-connected load balancing lets nginx try not to overload a busy application server by distributing new requests to a less busy server instead.5, source 5 With round-robin or least-connected load balancing, each subsequent request from a client can potentially go to a different server.5, source 5
With ip-hash load balancing, requests from the same client are always directed to the same server, except when that server is unavailable.5, source 5 When the weight parameter is specified for a server, the weight is accounted as part of the load balancing decision.5, source 5 When the response from a particular server fails with an error, nginx marks that server as failed and tries to avoid selecting it for subsequent inbound requests for a while.5, source 5 Setting max_fails to 0 disables health checks for that server.5, source 5
nginx can also act as a reverse proxy and load balancer for TCP and UDP servers, and as a mail proxy for IMAP, POP3 and SMTP.2, source 2 For mail, it can redirect people to an IMAP or POP3 server using an external HTTP authentication server.1, source 1
By default, the configuration file is named nginx.conf and is placed in the directory /usr/local/nginx/conf, /etc/nginx, or /usr/local/etc/nginx.3, source 3 nginx consists of modules which are controlled by directives specified in the configuration file.3, source 3 A simple directive consists of the name and parameters separated by spaces and ends with a semicolon.3, source 3
A block directive has the same structure as a simple directive, but instead of the semicolon it ends with a set of additional instructions surrounded by braces.3, source 3 A block directive that can have other directives inside its braces is called a context, such as events, http, server and location.3, source 3 The events and http directives reside in the main context, server in http, and location in server.3, source 3 A configuration file may include several server blocks distinguished by the ports on which they listen and by server names.3, source 3
With name-based virtual servers, nginx tests only the Host header field of the request to decide which server should receive it.6, source 6 When the Host value does not match any server name, or the request has no Host header field, nginx routes the request to the default server for that port.6, source 6 The default_server parameter of the listen directive sets explicitly which server is the default server for a port.6, source 6
Once nginx decides which server processes a request, it tests the URI specified in the request header against the parameters of the location directives defined inside the server block.3, source 3 A regular expression in a location directive should be preceded with a tilde (~).3, source 3 nginx first checks location directives that specify prefixes and remembers the one with the longest prefix, and then checks regular expressions; if one matches, nginx picks it, and otherwise it picks the prefix location remembered earlier.3, source 3
To start nginx, run the executable file.3, source 3 Once nginx is started, it can be controlled by invoking the executable with the -s parameter, using the syntax nginx -s signal.3, source 3 The command nginx -s reload reloads the nginx configuration.3, source 3 The command nginx -s quit stops nginx processes while waiting for the worker processes to finish serving current requests.3, source 3
Run nginx -s quit under the same user that started nginx.3, source 3 Changes made in the configuration file are not applied until the command to reload configuration is sent to nginx or it is restarted.3, source 3 When the master process receives the signal to reload configuration, it checks the syntax validity of the new configuration file and tries to apply it.3, source 3
When the new configuration applies successfully, the master process starts new worker processes and asks the old worker processes to shut down; otherwise it rolls back the changes and continues to work with the old configuration.3, source 3 Old worker processes stop accepting new connections and continue to service current requests until all of them are serviced.3, source 3 The process ID of the nginx master process is written by default to nginx.pid in the directory /usr/local/nginx/logs or /var/run.3, source 3
The -t command-line parameter tests the configuration file: nginx checks the configuration for correct syntax, and then tries to open files referred to in the configuration.7, source 7 The -V parameter prints the nginx version, compiler version and configure parameters.7, source 7 To rotate log files, rename them first, then send the USR1 signal to the master process.8, source 8 To upgrade the server executable, put the new executable file in place of the old file, then send the USR2 signal to the master process.8, source 8
To configure an HTTPS server in nginx, the ssl parameter must be enabled on listening sockets in the server block, and the locations of the server certificate and private key files should be specified.9, source 9 The server certificate is a public entity and is sent to every client that connects to the server.9, source 9 The private key should be stored in a file with restricted access, but it must be readable by the nginx master process.9, source 9 By default nginx uses "ssl_protocols TLSv1.2 TLSv1.3" and "ssl_ciphers HIGH:!aNULL:!MD5", so configuring them explicitly is generally not needed, and the defaults of these directives were changed several times.9, source 9
The most CPU-intensive SSL operation is the SSL handshake.9, source 9 Enabling keepalive connections and reusing SSL session parameters both minimize the number of SSL handshakes per client.9, source 9 SSL sessions are stored in an SSL session cache shared between workers and configured by the ssl_session_cache directive.9, source 9
When a certificate authority signs the server certificate with an intermediate certificate that a browser lacks, the authority provides a bundle of chained certificates that should be concatenated to the signed server certificate.9, source 9 In the combined certificate file, the server certificate must appear before the chained certificates.9, source 9 When the server certificate and the bundle are concatenated in the wrong order, nginx fails to start with a key values mismatch error.9, source 9
It is possible to configure a single nginx server that handles both HTTP and HTTPS requests.9, source 9 When two or more HTTPS servers listen on a single IP address, a browser receives the default server certificate regardless of the requested server name.9, source 9 The SSL connection is established before the browser sends an HTTP request, so nginx does not know the name of the requested server.9, source 9
A wildcard certificate secures all subdomains of the specified domain, but only on one level.9, source 9 Server Name Indication (SNI, RFC 6066) is a solution for running several HTTPS servers on a single IP address: it allows a browser to pass the requested server name during the SSL handshake, so the server knows which certificate to use.9, source 9 SNI is a mandatory-to-implement extension in TLSv1.3.9, source 9
Pre-built Linux packages are available for stable and mainline versions of nginx.10, source 10 Before installing nginx for the first time on a new machine, such as a VPS hosting server that you manage yourself, you need to set up the nginx packages repository.11, source 11
After the repository is set up, nginx can be installed and updated from it.11, source 11 On Red Hat Enterprise Linux and its derivatives, such as CentOS, Oracle Linux, Rocky Linux and AlmaLinux, nginx is installed with the command sudo yum install nginx.11, source 11 On Debian and Ubuntu, nginx is installed with sudo apt update followed by sudo apt install nginx.11, source 11
Since version 1.9.11, nginx supports dynamic modules.11, source 11 The main nginx package is built with all modules that do not require additional libraries, to avoid extra dependencies.11, source 11 The geoip, image-filter, njs, perl and xslt modules are built as dynamic modules and shipped as separate packages.11, source 11
NGINX Plus adds a range of premium features to address enterprise needs.2, source 2 Application load balancing, application health checks, activity monitoring and on-the-fly reconfiguration of server groups are available as part of paid NGINX Plus subscriptions.5, source 5 F5 documents a comparison of NGINX Plus and NGINX Open Source on its website.2, source 2
It serves web content, balances load and proxies requests. It also proxies TCP, UDP and mail traffic.
You reload it by running the command nginx -s reload. The master process checks the new configuration for syntax errors and tries to apply it. If that works, new worker processes start. Otherwise the master process rolls back the changes and keeps the old configuration.
Yes. nginx is open source software distributed under the 2-clause BSD License. Enterprise distributions, commercial support and training are available from F5, Inc.
NGINX Plus adds premium features to address enterprise needs. Paid NGINX Plus subscriptions include application load balancing, application health checks, activity monitoring and on-the-fly reconfiguration of server groups. Open source nginx also balances load, with round-robin as its default method.
You first need to set up the nginx package repository. After the repository is configured, you run sudo apt update followed by sudo apt install nginx to complete the installation.
It can route requests to FastCGI servers that run PHP applications. The most basic nginx configuration for a FastCGI server uses the fastcgi_pass directive, with fastcgi_param directives to set the parameters passed to that server.
Every fact on this page comes from one of these, checked before it goes live.
Servers and cloud
Server distributions like Ubuntu, Debian, RHEL, CentOS Stream, Rocky Linux, Oracle Linux and Amazon Linux vary by support length and release model.
· Mateo Cardenas
Servers and cloud
A server can be hardware, software or both, and it answers client requests. A web server finds the file your browser asks for and sends it back over HTTP.
· Mateo Cardenas
Servers and cloud
Linux is a free, open source operating system built around the Linux kernel. Red Hat names flexibility and security among the reasons people choose it.
· Mateo Cardenas
Servers and cloud
Ubuntu Server is a version of Ubuntu built as a backbone for the internet. LTS releases get 5 years of standard security maintenance, more with Ubuntu Pro.
· Mateo Cardenas