HostOnNet Blog

Install Nginx on CentOS 7

Looking for Linux Server Admin or WordPress Expert? We can help.

First enable epel repository by running

yum -y install epel-release
yum update

Now you can install nginx with

yum -y install nginx

Nginx configs are available in folder /etc/nginx, main config file is /etc/nginx/nginx.conf

To start nginx, run

service nginx start

To Stop, run

service nginx stop

To allow HTTP and HTTPS in firewall, run

firewall-cmd --permanent --zone=public --add-service=http 
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

Posted in Web Server

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.