CentOS 编译安装 NGINX
August 12, 2020
1. 安装依赖包
$ yum install wget gcc gcc-c++ make pcre-devel zlib-devel -y
2. 为 NGINX 服务创建用户
$ useradd -M -s /sbin/nologin www
3. 下载 openssl 和 nginx
开启 TLSv1.3 需要 nginx 版本不低于 1.13.0 以及 OpenSSL 版本不低于 1.1.1
wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz
wget https://nginx.org/download/nginx-1.14.2.tar.gz
# 解压
tar zxf openssl-1.1.1d.tar.gz
tar zxf nginx-1.14.2.tar.gz
4. 配置 & 编译 & 安装NGINX
$ cd nginx-1.14.2
$ ./configure --prefix=/usr/local/nginx \
--user=www --group=www \
--with-http_ssl_module --with-http_v2_module \
--with-http_gunzip_module --with-http_gzip_static_module \
--with-openssl=../openssl-1.1.1d
$ make && make install