This commit is contained in:
2022-01-27 19:42:55 +08:00
commit d0e08f6985
4 changed files with 104 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
set -e
tmpdir="$(mktemp -d)"
prefix="$1"
if [ -z "$prefix" ]; then
prefix="$(pwd)/nginx"
fi
mkdir -p "$prefix"
echo "Downloading nginx to $tmpdir"
wget -qO- http://nginx.org/download/nginx-1.21.6.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
echo "Compiling nginx"
make -j "$(nproc)"
echo "Installing nginx"
make install
popd # "$tmpdir/nginx-1.21.6"
echo "Cleaning up"
rm -rf "$tmpdir"