mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
The HOSTNAME environment var only contains the first part of the domain name. Use the fqdn to have it entirely.
24 lines
747 B
Bash
Executable File
24 lines
747 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eo pipefail
|
|
|
|
# latest stable NGINX 1.4.x with websocket support
|
|
add-apt-repository -y ppa:nginx/stable
|
|
apt-get update
|
|
apt-get install -y nginx dnsutils
|
|
|
|
if ! grep -q dokku-nginx-reload "/etc/sudoers"; then
|
|
touch /etc/sudoers.tmp
|
|
cp /etc/sudoers /tmp/sudoers.new
|
|
echo "%dokku ALL=(ALL)NOPASSWD:/etc/init.d/nginx reload # dokku-nginx-reload" >> /tmp/sudoers.new
|
|
EDITOR="cp /tmp/sudoers.new" visudo
|
|
rm /tmp/sudoers.new
|
|
fi
|
|
|
|
echo "include $DOKKU_ROOT/*/nginx.conf;" > /etc/nginx/conf.d/dokku.conf
|
|
|
|
sed -i 's/# server_names_hash_bucket_size/server_names_hash_bucket_size/' /etc/nginx/nginx.conf
|
|
|
|
[[ $(dig +short $(< "$DOKKU_ROOT/HOSTNAME")) ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST"
|
|
|
|
/etc/init.d/nginx start
|