How to Install Nginx on CentOS 7

Nginx pronounced engine x is a free, open-source, high-performance HTTP and reverse proxy server responsible for handling the load of some of the largest sites on the Internet.

Nginx can be used as a standalone web server, and as a reverse proxy for Apache and other web servers.

Compared to Apache, Nginx can handle a much large number of concurrent connections and has a smaller memory footprint per connection.

This tutorial will teach you how to install and manage Nginx on your CentOS 7 machine.

Prerequisites

Before starting with the tutorial, make sure you are logged in as a user with sudo privileges and you don’t have Apache or any other service running on port 80 or 443.

Installing Nginx on CentOS

Follow the steps below to install Nginx on your CentOS server:

  • Nginx packages are available in the EPEL repositories. If you don’t have EPEL repository already installed you can do it by typing:

 

sudo yum install epel-release