How to install NGINX on CentOS 7

In This tutorial we will look at, how to install NGINX on CentOS 7. Please follow steps carefully to configure the NGINX on CentOS.

NGINX
NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. NGINX is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.

$vi /etc/yum.repos.d/nginx.repo

Paste the following, it is necessary to manually replace $releasever with either 5 (for 5.x) or 6 (for 6.x), depending upon your OS version, and save the file.

[nginx]name=nginx repobaseurl=http://nginx.org/packages/centos/$releasever/$basearch/gpgcheck=0enabled=1Example:[nginx]name=nginx repobaseurl=http://nginx.org/packages/centos/7/$basearch/gpgcheck=0enabled=1

Now perform yum update to get the epel repository for NGINX and install the package.

$yum update$yum install nginx

Verify the installed NGINX server by checking the version. At the time of this blog the latest version of NGINX is v1.14.2

$nginx -v

Automatically start NGINX upon boot:

$systemctl restart nginx$systemctl enable nginx

Now verify the installation on the browser. If nginx was installed successfully, you should see nginx default page when you open http://localhost

Team,
DataHackr

Scroll to Top