From c89f442eeec82fe2060d1bf7a858936edd7b374b Mon Sep 17 00:00:00 2001 From: david_bai Date: Thu, 24 Jul 2025 22:36:42 +0800 Subject: [PATCH] fix:Reduce the scope of nginx configuration replacement to avoid incorrect replacement of subdomains --- backend/docker/Nginx/configure.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/docker/Nginx/configure.sh b/backend/docker/Nginx/configure.sh index 107a541..7c019a3 100644 --- a/backend/docker/Nginx/configure.sh +++ b/backend/docker/Nginx/configure.sh @@ -67,8 +67,8 @@ configure_nginx() { # Read the template and replace variables while IFS= read -r line || [ -n "$line" ]; do - # Replace server_name - if [[ $line =~ ^[[:space:]]*server_name[[:space:]]+ ]]; then + # Replace server_name only if it contains YourDomain placeholder + if [[ $line =~ ^[[:space:]]*server_name[[:space:]]+.*YourDomain ]]; then echo " server_name $NGINX_SERVER_NAME www.$NGINX_SERVER_NAME;" # Exactly match the frontend build path setting line elif [[ $line =~ ^[[:space:]]*set[[:space:]]+\$frontend_build_root[[:space:]]+ ]]; then