1、安装nginx依赖的库
yum install -y pcre pcre-devel
yum install -y zlib
yum install -y zlib-devel
yum install -y openssl-devel
yum install -y gcc
yum install -y gcc-c++
yum install -y wget
2、weget获取安装包
wget http://nginx.org/download/nginx-1.17.2.tar.gz
3、解压安装包
tar -zvxf nginx-1.17.2.tar.gz
4、安装nginx
./configure
make && make install
5、nginx命令
#启动
./nginx
#重启
./nginx -s reload
#关闭
./nginx -s stop
6、nginx全局变量
$remote_addr:客户端IP地址
$http_user_agent:客户端浏览器