Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: bec40a9d5e
Fetching contributors…

Cannot retrieve contributors at this time

executable file 57 lines (45 sloc) 1.33 kb
#!/bin/sh
trace_filter nginx || set -o xtrace
local domain="${project}"
typeset -g project_config domain
typeset -ga domains
if ! template exists "nginx/server.conf"
then
fail "$FUNCNAME: $extension_templates_path/server.conf template is missing."
fi
paths create "${service_config_path}/servers"
# If this is running as root, ensure that Nginx can read from the
# application directory.
if user is root && path exists "/home/${project}"
then
path chmod 'g+rx' recursive "/home/${project}"
fi
project_config="${service_config_path}/servers/${project}.conf"
if (( force_flag == 1 )) && file_exists "${project_config}"
then
remove_file "${project_config}"
fi
if ! [[ "${domain}" =~ "." ]]
then
domain="${domain}.com"
fi
if array is empty domains
then
domains=("${domain}" "*.${domain}")
fi
if ! files exist "${project_config}"
then
templates install "nginx/server.conf" \
to "${project_config}" \
with \
modules_path "${modules_path}" \
service "${service}" \
project "${project}" \
domain "${domain}" \
domains "${domains[*]}" \
project_path ${project_path:="/home/${project_user:-${project}}"} \
project_user "${project_user}" \
service_config_path "${service_config_path}" \
service_pid_file "${service_pid_file}" \
service_log_path "${service_log_path}"
fi
Jump to Line
Something went wrong with that request. Please try again.