Minor improvements.
This commit is contained in:
@ -1,20 +1,27 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Set the variables below then run this script to generate the config/nginx.conf
|
||||
# (the webserver configuration file for this service). Take a revision then
|
||||
# symlink it into the instances/.nginx folder and reload the webserver to activate.
|
||||
|
||||
PAR_SERVICENAME=
|
||||
PAR_PROXYHOST="localhost"
|
||||
PAR_PROXYPORT="8201"
|
||||
PAR_SERVERNAME="myservice.example.com"
|
||||
PAR_LOCATION=
|
||||
PAR_WEBMASTER="webmaster@example.com" # Valid support email address
|
||||
|
||||
################################################################################
|
||||
# There is nothing to change below this line (I hope)
|
||||
################################################################################
|
||||
|
||||
PAR_ACMEHOST="localhost"
|
||||
PAR_ACMEPORT="8100"
|
||||
PAR_SERVICE="$HOME/services/servicename"
|
||||
PAR_PROXYHOST="localhost"
|
||||
PAR_PROXYPORT="8201"
|
||||
PAR_SERVERNAME="www.example.com"
|
||||
PAR_LOCATION=""
|
||||
PAR_SERVICE="$HOME/services/$PAR_SERVICENAME"
|
||||
|
||||
# Do not change anything below.
|
||||
PARAMETERS='$PAR_ACMEHOST:$PAR_ACMEPORT:$PAR_SERVICE:$PAR_PROXYHOST:$PAR_PROXYPORT:$PAR_SERVERNAME:$PAR_LOCATION'
|
||||
PARAMETERS='$PAR_ACMEHOST:$PAR_ACMEPORT:$PAR_SERVICE:$PAR_PROXYHOST:$PAR_PROXYPORT:$PAR_SERVERNAME:$PAR_LOCATION:$PAR_WEBMASTER'
|
||||
for parameter in $(echo "$PARAMETERS" | tr ":" "\n")
|
||||
do export ${parameter:1}; done
|
||||
cat "$PAR_SERVICE/.templates/nginx/nginx.conf" | envsubst "$PARAMETERS" \
|
||||
> "$PAR_SERVICE/configs/nginx.conf"
|
||||
|
||||
touch $PAR_SERVICE/logs/web/access.log $PAR_SERVICE/logs/web/error.log
|
||||
chmod 660 $PAR_SERVICE/logs/web/access.log $PAR_SERVICE/logs/web/error.log
|
||||
[[ ! -a "$PAR_SERVICE/../.nginx/$PAR_SERVICENAME.conf" ]] \
|
||||
&& ln -s "../$PAR_SERVICENAME/configs/nginx.conf" "$PAR_SERVICE/../.nginx/$PAR_SERVICENAME.conf"
|
||||
|
Reference in New Issue
Block a user