1
0
mirror of https://github.com/dokku/buildpack-nginx.git synced 2025-06-26 10:30:46 +00:00

14 Commits
v3 ... v4

Author SHA1 Message Date
61c95d52d8 Merge pull request #2 from florianheinemann/master
florianheinemann updates
2015-11-25 10:22:57 -08:00
805e24be7f Merge pull request #9 from portokallidis/patch-1
Add documentation for nginx custom configuration
2015-10-30 13:15:32 +01:00
624cd06847 Add documentation for nginx custom configuration 2015-10-30 13:56:00 +02:00
7a023ab687 Merge pull request #8 from btkostner/master
added ROOT variable
2015-10-10 22:45:21 +02:00
69e450813e added ROOT param 2015-10-05 17:09:58 -07:00
b1370b9c56 Merge pull request #7 from Crispy1975/hotfix/path-test
Hotfix/path test
2015-09-11 11:50:51 +08:00
caa17b7718 Testing paths from other pack. 2015-09-10 18:57:55 +01:00
9da922ee28 Merge pull request #4 from Downchuck/master
Use full path of nginx executable
2015-07-27 14:39:23 -04:00
56bd6c514d Merge pull request #6 from Crispy1975/hotfix/fix-override
Fixing nginx user override.
2015-07-04 21:12:37 -04:00
23e4a8ab42 Removing rm line 2015-07-04 23:51:02 +01:00
ebbc9098d9 Fixing nginx user override. 2015-07-04 23:04:54 +01:00
1955dcaa72 Merge pull request #5 from Crispy1975/feature/inject-conf
Check for user defined nginx config
2015-07-03 23:10:43 -04:00
29bc30b8d3 Check for user defined nginx config 2015-07-03 22:23:06 +01:00
969446ca04 Use full path of nginx executable 2015-03-27 16:34:46 -07:00
3 changed files with 23 additions and 7 deletions

View File

@ -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

View File

@ -26,6 +26,8 @@ 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
[[ -f "$BUILD_DIR/www/nginx.conf.erb" ]] && mv $BUILD_DIR/www/nginx.conf.erb $BUILD_DIR
[[ -f "$BUILD_DIR/www/CHECKS" ]] && mv $BUILD_DIR/www/CHECKS $BUILD_DIR
rm -rf $CACHE_DIR/www
fi
@ -114,11 +116,18 @@ EOF
cd $CUR_DIR
# build nginx config unless overridden by user
#if [ ! -f $BUILD_DIR/nginx/nginx.conf ] ; then
echo "-----> using default nginx.conf.erb"
cp conf/nginx.conf.erb $BUILD_DIR/nginx/nginx.conf.erb
#fi
# Test for user override on nginx config...
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
# ...else, force default file
else
echo "-----> using default nginx.conf.erb"
cp conf/nginx.conf.erb $BUILD_DIR/nginx/nginx.conf.erb
fi
# build mime.types unless overridden by user
#if [ ! -f $BUILD_DIR/mime.types ] ; then
@ -131,6 +140,6 @@ cat <<EOF >"$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"

View File

@ -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;
}
}