mkdir /data/build/ && cd !$
 
wget https://dl.vqiu.cn/package/nginx/pcre-8.45.tar.bz2
wget https://dl.vqiu.cn/package/nginx/zlib-1.2.13.tar.gz
wget https://dl.vqiu.cn/package/nginx/openssl-1.1.1s.tar.gz
wget https://dl.vqiu.cn/package/nginx/nginx-1.21.6.tar.gz


cd /data/build
for pkg in `find /data/build/ -type f -name "*tar.*"`
do
    tar axvf ${pkg}
done



mkdir /data/build/modules && /data/build/modules
git clone --depth=1 https://github.com/arut/nginx-rtmp-module.git



./configure \
    --prefix=/opt/nginx \
    --user=nginx \
    --group=nginx \
    --with-zlib=/data/build/zlib-1.2.13 \
    --with-pcre=/data/build//pcre-8.45 \
    --with-openssl=/data/build//openssl-1.1.1s \
    --with-openssl-opt=enable-ec_nistp_64_gcc_128 \
    --with-openssl-opt=no-nextprotoneg \
    --with-openssl-opt=no-weak-ssl-ciphers \
    --with-openssl-opt=no-ssl3 \
    --with-threads \
    --with-compat \
    --with-http_v2_module \
    --with-http_ssl_module \
    --with-http_gunzip_module \
    --with-http_secure_link_module \
    --with-http_gzip_static_module \
    --with-http_realip_module \
    --with-http_stub_status_module \
    --with-http_addition_module \
    --with-http_slice_module \
    --with-file-aio \
    --with-http_random_index_module \
    --with-http_secure_link_module \
    --with-http_stub_status_module \
    --with-http_auth_request_module \
    --with-http_dav_module \
    --with-http_flv_module \
    --with-stream \
    --with-stream_ssl_module \
    --with-stream_ssl_module \
    --with-stream_ssl_preread_module \
    --with-stream_realip_module \
    --with-pcre-jit \
    --add-module=/data/build/modules/nginx-rtmp-module \
    --with-cc-opt='-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -fPIC -D_FORTIFY_SOURCE=2'
    make -j ${nproc}
    make install
