nginx server installation and configuration notes at 8 CentOS

installation

In CentOS, nginx official installation package can install the
first pre-installed software

sudo yum install yum-utils

Then nginx official source added to the yum source

#/etc/yum.repos.d/nginx.repo

[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

nginx is divided into two stable and mainline branch, by default the stable branch, the branch in accordance with the main line may be required to switch sudo yum-config-manager --enable nginx-mainline
to use the command to install nginx

sudo yum install nginx

Guess you like

Origin www.cnblogs.com/CoveredWithDust/p/nginx_guide.html