allow users to pass arguments to `nginx`

This commit is contained in:
Sameer Naik 2015-09-30 20:26:13 +05:30
parent 68c29dd167
commit 0ce21d49eb
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,10 @@
#!/bin/bash
if [ "${1}" == "nginx" -o "${1}" == "$(which nginx)" ]; then
if [ "${1:0:1}" = '-' ]; then
export EXTRA_OPTIONS="$@"
set --
elif [ "${1}" == "nginx" -o "${1}" == "$(which nginx)" ]; then
export EXTRA_OPTIONS="${@:2}"
set --
fi

View File

@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bash
set -e
source $BITNAMI_PREFIX/bitnami-utils.sh
exec nginx -g "daemon off;"
exec nginx -g "daemon off;" ${EXTRA_OPTIONS:+"$EXTRA_OPTIONS"}