1,下载nginx软件包
wget http://nginx.org/download/nginx-1.13.4.tar.gz
2,解压
tar xzvf nginx-1.13.4.tar.gz
3,配置编译安装
./configure --prefix=/usr/local/nginx-1.13.4 && make && make install
4,备份配置文件
cd /usr/local/nginx-1.13.4 && cp nginx.conf nginx.conf.bak
5,启动nginx
/usr/local/nginx-1.13.4/sbin/nginx -c /usr/local/nginx-1.13.4/conf/nginx.conf &
6,使用
/usr/local/nginx-1.13.4/sbin/nginx -s reload (重新加载配置文件,必须是默认位置的) /usr/local/nginx-1.13.4/sbin/nginx -s stop (停止nginx服务)