From bf574fa34fded4ba5b3dd889c5c8f144f9425961 Mon Sep 17 00:00:00 2001 From: Adam French Date: Sun, 30 Nov 2025 01:40:32 +0000 Subject: [PATCH] adding endpoint reference --- nginx/entrypoint.sh | 2 +- nginx/nginx.conf.template | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nginx/entrypoint.sh b/nginx/entrypoint.sh index 691b0fa..3bf1c47 100755 --- a/nginx/entrypoint.sh +++ b/nginx/entrypoint.sh @@ -4,7 +4,7 @@ set -e # Check if certificate exists if [ -f "/etc/letsencrypt/live/$DOMAIN/fullchain.pem" ] && [ -f "/etc/letsencrypt/live/$DOMAIN/privkey.pem" ]; then echo "Certificates found. Using production nginx config." - envsubst '${DOMAIN} ${BACKEND_HOST} ${BACKEND_PORT} ${ICECAST_HOST} ${ICECAST_PORT}' \ + envsubst '${DOMAIN} ${BACKEND_HOST} ${BACKEND_PORT} ${BACKEND_ENDPOINT} ${ICECAST_HOST} ${ICECAST_PORT}' \ < /etc/nginx/nginx.conf.template \ > /etc/nginx/nginx.conf else diff --git a/nginx/nginx.conf.template b/nginx/nginx.conf.template index b5dfaa4..9d81c8a 100644 --- a/nginx/nginx.conf.template +++ b/nginx/nginx.conf.template @@ -57,12 +57,12 @@ http { root /var/www/certbot; } - location = /api { - return 301 /api/; + location = $BACKEND_ENDPOINT { + return 301 $BACKEND_ENDPOINT/; } - location /api/ { - rewrite ^/api/(.*)$ /$1 break; + location $BACKEND_ENDPOINT/ { + rewrite ^$BACKEND_ENDPOINT/(.*)$ /$1 break; proxy_pass http://$BACKEND_HOST:$BACKEND_PORT/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr;