From 5d9c5e495da76b6c9b08cbea4fd718df18be2cf9 Mon Sep 17 00:00:00 2001 From: Chad Date: Sun, 23 Jul 2023 02:32:53 +0000 Subject: [PATCH] Small Reverse Proxy Enhancements (#8) * Only load certs for domains which are doing a proxy. 301 redirects do not need certs. * Fix tabs to spaces. * Add slash to match Hyperling.com script. * Fix comment capitalization. --- Config/Hyperling.com/Dockerfile | 6 +++--- Config/ReverseProxy/create_letsencrypt_certs.sh | 2 +- Config/ReverseProxy/create_placeholder_certs.sh | 2 +- Config/ReverseProxy/docker-compose.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Config/Hyperling.com/Dockerfile b/Config/Hyperling.com/Dockerfile index 85ad7a5..b7bab54 100644 --- a/Config/Hyperling.com/Dockerfile +++ b/Config/Hyperling.com/Dockerfile @@ -1,7 +1,7 @@ # 2022-10-29 Hyperling # Create website in node container and run it. -# Using Debian testing so that we use PHP >8. otherwise the shebangs from +# Using Debian testing so that we use PHP >8. Otherwise the shebangs from # the include files (#!/usr/bin/php) show up on the website. FROM debian:testing @@ -11,5 +11,5 @@ RUN apt update && apt install -y sudo php-fpm nodejs npm # Run Website CMD rm -rfv www && \ git clone https://github.com/Hyperling/www www && \ - cd www && \ - ./run.sh + cd www && \ + ./run.sh diff --git a/Config/ReverseProxy/create_letsencrypt_certs.sh b/Config/ReverseProxy/create_letsencrypt_certs.sh index 6484f1c..09a3067 100755 --- a/Config/ReverseProxy/create_letsencrypt_certs.sh +++ b/Config/ReverseProxy/create_letsencrypt_certs.sh @@ -48,7 +48,7 @@ fi ## Main ## # Loop over the proxy configuration files and ensure they have certs. -ls $DIR/config/conf.d/*.* | while read file; do +grep -l proxy_pass $DIR/config/conf.d/*.* | while read file; do filename=`basename $file` if [[ $filename == *"example.com"* ]]; then diff --git a/Config/ReverseProxy/create_placeholder_certs.sh b/Config/ReverseProxy/create_placeholder_certs.sh index fcc14f8..a591d41 100755 --- a/Config/ReverseProxy/create_placeholder_certs.sh +++ b/Config/ReverseProxy/create_placeholder_certs.sh @@ -18,7 +18,7 @@ echo "CERT_DIR=$CERT_DIR" mkdir -pv $CERT_DIR # Loop over the proxy configuration files and ensure they have certs. -ls $DIR/config/conf.d/*.* | while read file; do +grep -l proxy_pass $DIR/config/conf.d/*.* | while read file; do filename=`basename $file` echo "*** Checking $filename ***" if [[ ! -d $CERT_DIR/$filename ]]; then diff --git a/Config/ReverseProxy/docker-compose.yml b/Config/ReverseProxy/docker-compose.yml index 5b30a93..a4c9c21 100644 --- a/Config/ReverseProxy/docker-compose.yml +++ b/Config/ReverseProxy/docker-compose.yml @@ -9,7 +9,7 @@ version: '3' services: app: - build: . + build: ./ restart: always ports: - "80:80"