Skip to content

Instantly share code, notes, and snippets.

@dseg
Created February 16, 2016 00:41
Show Gist options
  • Save dseg/83e423542facbfc81c11 to your computer and use it in GitHub Desktop.
Save dseg/83e423542facbfc81c11 to your computer and use it in GitHub Desktop.
#!/bin/bash
VER=1.9.7.3
OPENRESTY=openresty-$VER.tar.gz
OPENSSL_PATH=/usr/local/src/openssl-OpenSSL_1_0_2f
# HTTP/2 patch for Nginx
#curl http://nginx.org/patches/http2/patch.http2-v2_1.9.3.txt -o http2.patch
# OpenResty
if [ ! -f "$OPENRESTY" ]; then
curl -O https://openresty.org/download/$OPENRESTY
fi
rm -rf "openresty-$VER"
# Nginx-ct
curl -L https://github.com/grahamedgecombe/nginx-ct/archive/master.tar.gz -o nginx-ct-master.tar.gz
# Unarchive
tar xvfz $OPENRESTY
tar xvfz nginx-ct-master.tar.gz
# Appy HTTP/2 patch
BASE_DIR=$(pwd)
cd openresty-$VER/bundle/nginx-1.9.7
#patch -p1 -i $BASE_DIR/http2.patch
cd $BASE_DIR
if [ ! -d stream-lua-nginx-module ]; then
git clone https://github.com/openresty/stream-lua-nginx-module.git
fi
if [ ! -d stream-echo-nginx-module ]; then
git clone https://github.com/openresty/stream-echo-nginx-module.git
fi
# Configure
cd openresty-$VER
./configure \
--with-http_v2_module \
--with-http_ssl_module \
--with-openssl=$OPENSSL_PATH \
--with-http_v2_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-threads \
--with-stream \
--with-stream_ssl_module \
--with-http_postgres_module \
--with-file-aio \
--add-module="$BASE_DIR/nginx-ct-master" \
--add-module="$BASE_DIR/stream-lua-nginx-module" \
--add-module="$BASE_DIR/stream-echo-nginx-module" \
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment