HostOnNet Blog

Install Nginx on CentOS 7

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