#!/usr/bin/env bash

source "$(dirname $0)/../dokku_common"

sed -i 's/# server_names_hash_bucket_size/server_names_hash_bucket_size/' /etc/nginx/nginx.conf

if [[ ! -f  "$DOKKU_ROOT/VHOST" ]]; then
  [[ $(dig +short $(< "$DOKKU_ROOT/HOSTNAME")) ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
fi

/etc/init.d/nginx start
