From 969446ca0403a0c8d37d636298ba2dd443d341c0 Mon Sep 17 00:00:00 2001 From: Charles Pritchard Date: Fri, 27 Mar 2015 16:34:46 -0700 Subject: [PATCH 1/7] Use full path of nginx executable --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index e21c7aa..0c712d5 100755 --- a/bin/compile +++ b/bin/compile @@ -125,6 +125,6 @@ cat <"$BUILD_DIR/start_nginx" #!/usr/bin/env bash rm -f /app/nginx/nginx.conf erb /app/nginx/nginx.conf.erb > /app/nginx/nginx.conf -exec nginx -p /app/nginx -c /app/nginx/nginx.conf +exec /app/nginx/nginx -p /app/nginx -c /app/nginx/nginx.conf EOF chmod +x "$BUILD_DIR/start_nginx" From 23e4a8ab426a8e9b6f773d390ddbf3d1fd838b97 Mon Sep 17 00:00:00 2001 From: Paul Caselton Date: Sat, 4 Jul 2015 23:51:02 +0100 Subject: [PATCH 2/7] Removing rm line --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 4833af9..eea3478 100755 --- a/bin/compile +++ b/bin/compile @@ -115,7 +115,7 @@ cd $CUR_DIR if [ -f $BUILD_DIR/nginx.conf.erb ] ; then echo "-----> using user provided nginx.conf.erb" cp $BUILD_DIR/nginx.conf.erb $BUILD_DIR/nginx/nginx.conf.erb - rm $BUILD_DIR/nginx.conf.erb + #rm $BUILD_DIR/nginx.conf.erb # ...else, force default file else From caa17b7718de1dbcb3ba360bd08d82c8894bb6e4 Mon Sep 17 00:00:00 2001 From: Paul C Date: Thu, 10 Sep 2015 18:57:55 +0100 Subject: [PATCH 3/7] Testing paths from other pack. --- bin/compile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/compile b/bin/compile index eea3478..adc4a40 100755 --- a/bin/compile +++ b/bin/compile @@ -108,6 +108,12 @@ else cp -r $CACHE_DIR/bin/* $BUILD_DIR/nginx/ fi +# Update the PATH +mkdir -p $BUILD_DIR/.profile.d +cat > $BUILD_DIR/.profile.d/nginx.sh <<"EOF" +export PATH="$PATH:$HOME/nginx" +EOF + cd $CUR_DIR From 69e450813edba6b316328b7f14734c245b8bf9fb Mon Sep 17 00:00:00 2001 From: Blake Kostner Date: Mon, 5 Oct 2015 17:03:08 -0700 Subject: [PATCH 4/7] added ROOT param --- conf/nginx.conf.erb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf.erb b/conf/nginx.conf.erb index 2189ddb..82e8b4d 100644 --- a/conf/nginx.conf.erb +++ b/conf/nginx.conf.erb @@ -13,7 +13,11 @@ http { server { listen <%= ENV["PORT"] %>; server_name _; - root /app/www; + <% if ENV["ROOT"] %> + root /app/www/<%= ENV["ROOT"] %>; + <% else %> + root /app/www; + <% end %> index index.html; } } From 624cd06847232804881e91ef0b705b7cb29e788b Mon Sep 17 00:00:00 2001 From: Nick Portokallidis Date: Fri, 30 Oct 2015 13:56:00 +0200 Subject: [PATCH 5/7] Add documentation for nginx custom configuration --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index dd226ac..1f5b03a 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,9 @@ This buildpack has been successfully run on Digital Ocean instances of Ubuntu 14 All static files that you want to serve should be in the root directory of your repository. No need to use a seperate `www` folder. `buildpack-nginx` will automatically download the buildpack, download NGINX, compile it, and install it. The next time you push your project, the buildpack will reuse the precompiled binaries. +## NGINX CONFIGURATION +Override default configuration by adding `nginx.conf.erb` in the root directory + ## Credits and License `buildpack-nginx` is licensed under the CC0 1.0 Universal license and has been informed by many similar projects on the web From 12fe84ae6b3e38b93d74cf61e2b128711de027e2 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 4 Dec 2015 09:34:49 -0800 Subject: [PATCH 6/7] Update PCRE version to fix broken compile step --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 97435ed..f003c9f 100755 --- a/bin/compile +++ b/bin/compile @@ -7,7 +7,7 @@ set -o pipefail # Nginx 1.6.2 NGINX_VERSION="1.6.2" NGINX_TARBALL="nginx-${NGINX_VERSION}.tar.gz" -PCRE_VERSION="8.36" +PCRE_VERSION="8.38" PCRE_TARBALL="pcre-${PCRE_VERSION}.tar.gz" ZLIB_VERSION="1.2.8" ZLIB_TARBALL="zlib-${ZLIB_VERSION}.tar.gz" From 7d773187bba68f7f2cb20ee638a7f624a52c184f Mon Sep 17 00:00:00 2001 From: Kyle Mattimore Date: Wed, 23 Dec 2015 14:14:33 -0500 Subject: [PATCH 7/7] restored ability to use custom mime.types --- bin/compile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/bin/compile b/bin/compile index f003c9f..76bd78a 100755 --- a/bin/compile +++ b/bin/compile @@ -26,8 +26,9 @@ if [[ ! -e "$BUILD_DIR/www" ]]; then mv $BUILD_DIR/* $CACHE_DIR/www mkdir -p $BUILD_DIR/www mv $CACHE_DIR/www/* $BUILD_DIR/www - # Check for an copy the nginx conf file override to the build dir + # Check for a copy the nginx conf file override to the build dir [[ -f "$BUILD_DIR/www/nginx.conf.erb" ]] && mv $BUILD_DIR/www/nginx.conf.erb $BUILD_DIR + [[ -f "$BUILD_DIR/www/mime.types" ]] && mv $BUILD_DIR/www/mime.types $BUILD_DIR [[ -f "$BUILD_DIR/www/CHECKS" ]] && mv $BUILD_DIR/www/CHECKS $BUILD_DIR rm -rf $CACHE_DIR/www fi @@ -130,10 +131,15 @@ else fi # build mime.types unless overridden by user -#if [ ! -f $BUILD_DIR/mime.types ] ; then -echo "-----> using default mime.types" -cp conf/mime.types $BUILD_DIR/nginx/mime.types -#fi +if [ -f $BUILD_DIR/mime.types ] ; then + echo "-----> using user provided mime.types" + cp $BUILD_DIR/mime.types $BUILD_DIR/nginx/mime.types + +else + echo "-----> using default mime.types" + cp conf/mime.types $BUILD_DIR/nginx/mime.types +fi + # build a startup script cat <"$BUILD_DIR/start_nginx"