0. Prerequisites openssl 1.1.1

1. Install redhat-lsb-core

yum install redhat-lsb-core

yum -y install wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel pcre-devel

2. User add

useradd builder
groupadd builder

3. download

wget http://nginx.org/packages/mainline/centos/7/SRPMS/nginx-1.15.8-1.el7_4.ngx.src.rpm

4. Configuration

rpm -ivh nginx-1.15.8-1.el7_4.ngx.src.rpm
sed -i “s|–with-http_ssl_module|–with-http_ssl_module –with-openssl=/usr/local/src/openssl-1.1.1a –with-openssl-opt=enable-tls1_3 |g” /root/rpmbuild/SPECS/nginx.spec

5. Compile

rpmbuild -ba /root/rpmbuild/SPECS/nginx.spec

6. Install

rpm -ivh /root/rpmbuild/RPMS/x86_64/nginx-1.15.8-1.el7_4.ngx.x86_64.rpm

7. Check version

nginx -v

8. Reference