到 cd /etc/yum.repos.d/ 目录下
新建 vim 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 [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
安装
yum -y install nginx
nginx配置文件
vim /etc/nginx/nginx.conf