Nginx (pronounced "engine-ex") is an open source web server created by Igor Sysoev. High performance, low memory use, thanks to an event-driven architecture that handles thousands of requests at once. It also ships with a reverse proxy, an HTTP cache, and a load balancer.
Before installing, there are two versions:
- Mainline: has all of Nginx's latest features and fixes, but may contain new bugs.
- Stable: doesn't have all the latest features, but does include the critical bug fixes.
In production, use the stable version, which is the one shown below.
Installing Nginx on Ubuntu and Debian
Update the repository:
sudo apt updateInstall the nginx package:
sudo apt install nginxCheck the installation:
sudo nginx -v
nginx version: nginx/1.18.0Check that Nginx is running:
curl -I 127.0.0.1
HTTP/1.1 200 OK
Server: nginx/1.18.0Installing Nginx on CentOS
Install the EPEL repository:
sudo yum install epel-releaseUpdate the repository:
sudo yum updateInstall the nginx package:
sudo yum install nginxCheck the installation:
sudo nginx -v
nginx version: nginx/1.18.0Check that Nginx is running:
curl -I 127.0.0.1
HTTP/1.1 200 OK
Server: nginx/1.18.0See here for installing Nginx on other Linux distributions.
