TL;rd

wget http://nginx.org/download/nginx-1.17.4.tar.gz
wget https://www.zlib.net/zlib-1.2.11.tar.gz
wget https://ftp.gnu.org/gnu/readline/readline-8.0.tar.gz
wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz
##
git clone https://github.com/hakasenyang/openssl-patch.git

tar -xvf nginx-1.17.4.tar.gz
tar -xvf openssl-1.1.1d.tar.gz
tar -xvf zlib-1.2.11.tar.gz
tar -xvf pcre-8.43.tar.gz

yum -y install patch

cd openssl-1.1.1d/ && patch -p1 < ../openssl-patch/openssl-equal-1.1.1d_ciphers.patch

exp

cd nginx-1.17.4
#sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' auto/cc/gcc
sed -i.bak 's/CFLAGS="$CFLAGS -g"/#CFLAGS="$CFLAGS -g"/g' auto/cc/gcc
#./configure --prefix=/data/nginx --with-http_ssl_module --with-http_v2_module --with-http_stub_status_module --with-openssl=../openssl-1.1.1a --with-zlib=../zlib-1.2.11 --with-pcre=../pcre-8.42 --add-module=../ngx_brotli

./configure --prefix=/data/nginx \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_stub_status_module \
--with-http_slice_module \
--with-compat \
--with-file-aio \
--with-threads \
--with-stream \
--with-stream_ssl_module \
--with-stream_ssl_preread_module \
--with-openssl=../openssl-1.1.1d \
--with-zlib=../zlib-1.2.11 \
--with-pcre=../pcre-8.43 \
--with-pcre-jit \
--user=www \
--with-cc-opt='-O3'

# 可选
--add-module=../ngx_brotli \
--add-module=../incubator-pagespeed-ngx-1.13.35.2-stable \
--with-ld-opt="-ljemalloc"

# 创建用户

/sbin/groupadd www
/sbin/useradd www -g www -s /sbin/nologin -M
id www

#
#两年=730天=17520小时=1051200分=63072000秒
#一年=365*24*60*60=31536000秒

ref