Skip to content

Instantly share code, notes, and snippets.

@sfan5 sfan5/nginx-libressl.sh
Last active Dec 26, 2018

Embed
What would you like to do?
Compiles nginx statically linked with libressl
#!/bin/bash -e
LIBRESSL_VERSION=2.8.3
NGINX_VERSION=1.15.8
NGINX_CONFIG="--with-pcre-jit --with-threads --with-http_ssl_module --with-http_v2_module"
[ -f libressl.tar.gz ] || \
wget https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-$LIBRESSL_VERSION.tar.gz \
-O libressl.tar.gz
[ -d libressl ] || {
mkdir libressl
tar -xz --strip-components=1 -f libressl.tar.gz -C libressl
}
cd libressl
./configure --prefix=/ --with-openssldir=/etc/ssl --disable-shared
make -j4
make DESTDIR=$PWD/_install install
cd ..
[ -f nginx.tar.gz ] || \
wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -O nginx.tar.gz
[ -d nginx ] || {
mkdir nginx
tar -xz --strip-components=1 -f nginx.tar.gz -C nginx
sed 's|/\.openssl/|/_install/|g' -i nginx/auto/lib/openssl/conf
echo >nginx/auto/lib/openssl/make
}
cd nginx
./configure $NGINX_CONFIG --with-openssl=$PWD/../libressl
make -j4
cd ..
echo
echo "Done."
echo "If you want to install nginx system-wide run:"
echo " \$ cd nginx; sudo make install"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.