Skip to content

Instantly share code, notes, and snippets.

@dseg
Created December 9, 2015 12:25
Show Gist options
  • Save dseg/8a60114add2aa607373f to your computer and use it in GitHub Desktop.
Save dseg/8a60114add2aa607373f to your computer and use it in GitHub Desktop.
#!/bin/bash
# build_openresty_with_http2_patch.sh
# Date: 10-Dec-2015
# Tested with: Ubuntu 14.04
VER=1.9.3.2
OPENRESTY=ngx_openresty-$VER.tar.gz
OPENSSL_PATH=/usr/local/src/openssl-1.0.2e
# HTTP/2 patch for Nginx
curl http://nginx.org/patches/http2/patch.http2-v2_1.9.3.txt -o http2.patch
# OpenResty
curl -O https://openresty.org/download/$OPENRESTY
rm -rf "ngx_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 ngx_openresty-$VER/bundle/nginx-1.9.3
patch -p1 -i $BASE_DIR/http2.patch
cd $BASE_DIR
# Configure
cd ngx_openresty-$VER
./configure \
--with-http_v2_module \
--with-debug \
--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-http_postgres_module \
--with-file-aio \
--add-module="$BASE_DIR/nginx-ct-master"
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment