# 安装相关依赖
[root@master /]# yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
[root@master /]# cd opt/
# 下载安装包
[root@master opt]# wget http://nginx.org/download/nginx-1.15.9.tar.gz
# 解压
[root@master opt]# tar -zxvf nginx-1.15.9.tar.gz
# 进入
[root@master opt]# cd nginx-1.15.9
# 编译
[root@master nginx-1.15.9]# ./configure --prefix=/usr/local/nginx/ --with-http_ssl_module --with-http_stub_status_module
[root@master nginx-1.15.9]# make && make install
[root@master sbin]# cd /usr/local/nginx/sbin
# 启动
[root@master sbin]# ./nginx -c /usr/local/nginx/conf/nginx.conf
# 测试
[root@master sbin]# crul localhost:80
# 停止
[root@master sbin]# ./nginx -s stop
原文:https://www.cnblogs.com/q-linyu/p/14753591.html