Centos7 yum installs the latest and stable version of nginx
1. First create the nginx official source
Vim / etc/yum.repos.d/nginx.repo
[nginx]
Name=nginx repo
Baseurl= http://nginx.org/packages/centos/7/$basearch/
Gpgcheck=0
Enabled=1
2. Download nginx from yum
Yum install nginx-y
3. Check the nginx version after the download is completed
[root@jiankong local] # nginx-v
Nginx version: nginx/1.16.1
The default html root directory is: / usr/share/nginx/html
The default configuration files are: / etc/nginx/conf.d/default.conf and / etc/nginx/nginx.conf