Certs were not being saved by LetsEncrypt for Nginx correctly. Should be working now.

This commit is contained in:
2023-08-18 20:44:39 -07:00
parent 5f30fa5a67
commit ec80af1bb2
3 changed files with 33 additions and 11 deletions

View File

@@ -18,12 +18,14 @@ echo "CERT_DIR=$CERT_DIR"
mkdir -pv $CERT_DIR
# Loop over the proxy configuration files and ensure they have certs.
grep -l proxy_pass $DIR/config/conf.d/*.* | while read file; do
#grep -l proxy_pass $DIR/config/conf.d/*.* | while read file; do
ls $DIR/config/conf.d/*.* | while read file; do
filename=`basename $file`
echo "*** Checking $filename ***"
echo -e "\n\n*** Checking $filename ***"
if [[ ! -d $CERT_DIR/$filename ]]; then
echo "Creating self-signed certs at $CERT_DIR/$filename."
mkdir -pv $CERT_DIR/$filename
touch $CERT_DIR/$filename/SELF
openssl req -new -x509 -days 3 -nodes \
-out $CERT_DIR/$filename/fullchain.pem \
-keyout $CERT_DIR/$filename/privkey.pem \