https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-open-source/#sources
wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
tar -zxf pcre-8.44.tar.gz
rm pcre-8.44.tar.gz
cd pcre-8.44
./configure
make
sudo make install
cd ..
wget http://zlib.net/zlib-1.2.11.tar.gz
tar -zxf zlib-1.2.11.tar.gz
rm zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make
sudo make install
cd ..
wget http://www.openssl.org/source/openssl-1.1.1c.tar.gz
tar -zxf openssl-1.1.1c.tar.gz
rm openssl-1.1.1c.tar.gz
cd openssl-1.1.1c
./Configure linux-x86_64 --prefix=/usr
make
sudo make install
cd ..
wget https://nginx.org/download/nginx-1.17.9.tar.gz
tar zxf nginx-1.17.9.tar.gz
rm nginx-1.17.9.tar.gz
cd nginx-1.17.9
./configure --prefix=/usr/local/nginx --user=www-data --with-pcre=../pcre-8.44 --with-zlib=../zlib-1.2.11 --with-openssl=../openssl-1.1.1c --with-http_ssl_module --with-stream --with-mail=dynamic --with-http_stub_status_module --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_sub_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-mail_ssl_module
make
sudo make install