Files
restream-tools/scripts/nginx/build.sh
T

34 lines
718 B
Bash
Executable File

#!/bin/bash
set -e
tmpdir="$(readlink -f $(mktemp -d -p .))"
prefix="$(pwd)/nginx"
mkdir -p "$prefix"
echo "Downloading nginx to $tmpdir"
wget -qO- http://nginx.org/download/nginx-1.21.6.tar.gz | tar -xzv -C "$tmpdir"
echo "Downloading openssl to $tmpdir"
wget -qO- https://www.openssl.org/source/openssl-1.1.1m.tar.gz | tar -xzv -C "$tmpdir"
pushd "$tmpdir/nginx-1.21.6"
echo "Configuring nginx"
./configure \
--prefix="$prefix" \
--with-http_ssl_module --with-threads --with-http_realip_module \
--with-openssl="$tmpdir/openssl-1.1.1m"
echo "Compiling nginx"
make -j "$(nproc)"
echo "Installing nginx"
make install
popd # "$tmpdir/nginx-1.21.6"
echo "Cleaning up"
rm -rf "$tmpdir"