2
0

Nginx enhancements - split configuration (nginx_*.inc stubs)

This commit is contained in:
2025-03-06 19:03:08 +01:00
parent eb5ede75f0
commit 0342dfe641
5 changed files with 38 additions and 21 deletions

View File

@ -1,11 +1,11 @@
#!/bin/bash
PAR_SERVICENAME=
PAR_SERVICENAME=""
PAR_PROXYHOST="localhost"
PAR_PROXYPORT="8201"
PAR_SERVERNAME="myservice.example.com"
PAR_LOCATION=
PAR_WEBMASTER="webmaster@example.com" # Valid support email address
PAR_WEBMASTER="webmaster@example.com" # Valid support email address
################################################################################
# There is nothing to change below this line (I hope)
@ -18,8 +18,13 @@ PAR_SERVICE="$HOME/services/$PAR_SERVICENAME"
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"
for template in $(cd "$PAR_SERVICE/.templates/nginx/"; ls -1 nginx*) ""
do
if [ -n "$template" ]; then
cat "$PAR_SERVICE/.templates/nginx/$template" | envsubst "$PARAMETERS" \
> "$PAR_SERVICE/configs/$template"
fi
done
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