#!/bin/bash
set -e

NGINX_VERSION=1.8.0


echo "Extracting nginx..."
tar xzvf nginx/nginx-$NGINX_VERSION.tar.gz

if [[ $? != 0 ]] ; then
  echo "Failed extracting nginx"
  exit 1
fi

echo "Building nginx..."
cd nginx-$NGINX_VERSION
./configure \
  --prefix=${BOSH_INSTALL_TARGET} \
  --with-http_ssl_module \
  --without-http_rewrite_module

make
make install
