VPS & Dedicated Servers (Hosting Control Center) Help

How to install nginx on CentOS 7

Nginx is primarily a web server for various protocols such as HTTP, HTTPS, IMAP, POP3 and SMTP. It also performs other functions, including HTTP caching, load balancing and acting as a reverse proxy. Nginx is open-source software that runs on Linux-like operating systems such as CentOS. It’s distributed as a binary package that contains all of the files needed to install nginx, including a public PGP key and configuration file. This installation requires you to install the nginx software repository and then install the actual software from the repository.

Install the nginx yum configuration file for this package with the following rpm command:

# rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm

Install nginx

The following yum command will install nginx from the yum configuration file by automatically answering "yes" to all questions.

# yum install nginx

The yum command will produce output similar to the following if nginx installs successfully:

Enter the following commands to enable and start nginx:

# chkconfig nginx on

# service nginx start

(If you have another service listening on port 80, such as Apache - you will have to stop that service prior to starting nginx. You can also change the port that nginx listens on by modifying the /etc/nginx/conf.d/default.conf file).

Enter the following URL into your browser:

http://127.0.0.1:80

This page should look like the following screenshot if nginx is running correctly:

Was This Article Helpful?

Thanks for your feedback. To speak with a customer service representative, please use the support phone number or chat option above.

Glad we helped! Anything more we can do for you?

Sorry about that. Tell us what was confusing or why the solution didn’t solve your problem.