diff --git a/.docker/openresty/entrypoint.sh b/.docker/openresty/entrypoint.sh index 193b4a4d..f47e75d5 100644 --- a/.docker/openresty/entrypoint.sh +++ b/.docker/openresty/entrypoint.sh @@ -32,12 +32,12 @@ FULLCHAIN="fullchain.pem" PRIVATE_KEY="private.key" USE_HTTPS="1" -if [ -z "$DOMAIN" ]; then - echo_error "❌ 错误:必须设置 DOMAIN 环境变量!" +if [ -z "$NP_DOMAIN" ]; then + echo_error "❌ 错误:必须设置 NP_DOMAIN 环境变量!" exit 1 fi -echo_info "DOMAIN: $DOMAIN" +echo_info "NP_DOMAIN: $NP_DOMAIN" # 检查证书是否存在 if [ -f "$CERT_DIR/$FULLCHAIN" ] && [ -f "$CERT_DIR/$PRIVATE_KEY" ]; then @@ -50,12 +50,12 @@ fi echo_info "USE_HTTPS: $USE_HTTPS" # 组合子域名变量 -export PHPMYADMIN_SERVER_NAME="phpmyadmin.${DOMAIN}" +export PHPMYADMIN_SERVER_NAME="phpmyadmin.${NP_DOMAIN}" # 生成配置 APP_CONF="/etc/nginx/conf.d/app.conf" PMA_CONF="/etc/nginx/conf.d/phpmyadmin.conf" -envsubst '$DOMAIN' < /etc/nginx/conf.d/sites/app.conf.template > "$APP_CONF" +envsubst '$NP_DOMAIN' < /etc/nginx/conf.d/sites/app.conf.template > "$APP_CONF" envsubst '$PHPMYADMIN_SERVER_NAME' < /etc/nginx/conf.d/sites/phpmyadmin.conf.template > "$PMA_CONF" # if no certs, remove ssl configuration diff --git a/.docker/openresty/sites/app.conf.template b/.docker/openresty/sites/app.conf.template index 8ea4bb44..8f517364 100644 --- a/.docker/openresty/sites/app.conf.template +++ b/.docker/openresty/sites/app.conf.template @@ -1,6 +1,6 @@ server { listen 443 ssl http2; - server_name ${DOMAIN}; + server_name ${NP_DOMAIN}; root /var/www/html/public; index index.php index.html; diff --git a/app/Http/Middleware/Locale.php b/app/Http/Middleware/Locale.php index 667c3f71..43c45c66 100644 --- a/app/Http/Middleware/Locale.php +++ b/app/Http/Middleware/Locale.php @@ -41,7 +41,7 @@ class Locale /** @var Response $response */ $response = $next($request); if ($response instanceof Response || $response instanceof JsonResponse) { - $response->header('Request-Id', nexus()->getRequestId())->header('Running-In-Octane', RUNNING_IN_OCTANE ? 1 : 0); + $response->header('X-Request-Id', nexus()->getRequestId())->header('X-NexusPHP-Version', VERSION_NUMBER); } return $response; } diff --git a/docker-compose.yml b/docker-compose.yml index 6d9bcb75..2356dfe3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,7 +62,7 @@ services: context: ./.docker/openresty container_name: nexusphp-openresty environment: - DOMAIN: ${DOMAIN} + DOMAIN: ${NP_DOMAIN} volumes: - ./.docker/openresty/sites:/etc/nginx/conf.d/sites - ./.docker/openresty/certs:/certs