Skip to content
This repository was archived by the owner on May 7, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
BIN_DIR=$(cd $(dirname $0); pwd) # absolute path
ROOT_DIR=$(dirname $BIN_DIR)
mkdir -p "$1/bin/"
cp "${ROOT_DIR}/bin/nginx-$STACK" "$1/bin/nginx"
cp "${ROOT_DIR}/bin/nginx-hmrc" "$1/bin/nginx"
nginx_version=$(${ROOT_DIR}/bin/nginx-$STACK -V 2>&1 | head -1 | awk '{ print $NF }')
echo "-----> nginx-buildpack: Installed ${nginx_version} to app/bin"
cp ${ROOT_DIR}/bin/start-nginx "$1/bin/"
Expand Down
Binary file added bin/nginx-hmrc
Binary file not shown.
34 changes: 15 additions & 19 deletions scripts/build_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@
# Once the dyno has is 'up' you can open your browser and navigate
# this dyno's directory structure to download the nginx binary.

NGINX_VERSION=${NGINX_VERSION-1.5.7}
NGINX_VERSION=${NGINX_VERSION-1.8.0}
PCRE_VERSION=${PCRE_VERSION-8.21}
HEADERS_MORE_VERSION=${HEADERS_MORE_VERSION-0.23}
OPEN_SSL_VERSION=${OPEN_SSL_VERSION-1.0.2d}

nginx_tarball_url=http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz
pcre_tarball_url=http://garr.dl.sourceforge.net/project/pcre/pcre/${PCRE_VERSION}/pcre-${PCRE_VERSION}.tar.bz2
headers_more_nginx_module_url=https://github.com/agentzh/headers-more-nginx-module/archive/v${HEADERS_MORE_VERSION}.tar.gz
ssl_tarball_url=https://www.openssl.org/source/openssl-${OPEN_SSL_VERSION}.tar.gz

temp_dir=$(mktemp -d /tmp/nginx.XXXXXXXXXX)

echo "Serving files from /tmp on $PORT"
cd /tmp
python -m SimpleHTTPServer $PORT &
temp_dir=$(mktemp -d /tmp/nginx.XXXXXXXXXX)

cd $temp_dir
echo "Temp dir: $temp_dir"
Expand All @@ -35,17 +34,14 @@ echo "Downloading $pcre_tarball_url"
echo "Downloading $headers_more_nginx_module_url"
(cd nginx-${NGINX_VERSION} && curl -L $headers_more_nginx_module_url | tar xvz )

(
cd nginx-${NGINX_VERSION}
./configure \
--with-pcre=pcre-${PCRE_VERSION} \
--prefix=/tmp/nginx \
--add-module=/${temp_dir}/nginx-${NGINX_VERSION}/headers-more-nginx-module-${HEADERS_MORE_VERSION}
make install
)

while true
do
sleep 1
echo "."
done
echo "Downloading $ssl_tarball_url"
(cd nginx-${NGINX_VERSION} && curl -L $ssl_tarball_url | tar xvz )

cd nginx-${NGINX_VERSION}
./configure \
--with-pcre=pcre-${PCRE_VERSION} \
--prefix=/tmp/nginx \
--add-module=/${temp_dir}/nginx-${NGINX_VERSION}/headers-more-nginx-module-${HEADERS_MORE_VERSION} \
--with-http_ssl_module --with-openssl=./openssl-${OPEN_SSL_VERSION}
make -j1 install