Merge pull request #86 from eugeneware/domain_support

support for fully qualified domain names not just subdomains
This commit is contained in:
Jeff Lindsay
2013-07-19 13:24:00 -07:00

View File

@@ -3,7 +3,13 @@ set -e
APP="$1"; PORT="$2"
if [[ -f "$HOME/VHOST" ]]; then
hostname="${APP/\//-}.$(< "$HOME/VHOST")"
VHOST=$(< "$HOME/VHOST")
SUBDOMAIN=${APP/%\.${VHOST}/}
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
hostname="${APP/\//-}"
else
hostname="${APP/\//-}.$VHOST"
fi
cat<<EOF > $HOME/$APP/nginx.conf
upstream $APP { server 127.0.0.1:$PORT; }
server {