This commit is contained in:
vet
2026-04-14 15:20:00 +07:00
parent 3332ec541a
commit 4ce37703b3
8 changed files with 192 additions and 27 deletions

View File

@@ -55,11 +55,13 @@ echo ""
echo -e "${BOLD}[ Nginx 网关PC API / WebSocket]${NC}"
if command -v curl &>/dev/null && [[ -n "${PC_BACKEND_ORIGIN:-}" ]]; then
PC_BACKEND_ORIGIN="${PC_BACKEND_ORIGIN%/}"
if curl -fsS --max-time 3 "${PC_BACKEND_ORIGIN}/nginx-health" >/dev/null 2>&1; then
curl_tls=()
[[ "$PC_BACKEND_ORIGIN" == https://* ]] && curl_tls=(-k)
if curl "${curl_tls[@]}" -fsS --max-time 3 "${PC_BACKEND_ORIGIN}/nginx-health" >/dev/null 2>&1; then
printf " ${GREEN}${NC} %-14s %s\n" "nginx-health" "${PC_BACKEND_ORIGIN}/nginx-health"
else
printf " ${RED}${NC} %-14s %s\n" "nginx-health" "${PC_BACKEND_ORIGIN}/nginx-health 不可达"
echo " 请执行: sudo ./deploy-test/00-init-tools.sh nginx并确认安全组/防火墙放行 TCP 80"
echo " 请执行: sudo ./deploy-test/00-init-tools.sh nginx并确认安全组/防火墙放行 TCP 80/443"
fi
gateway_host=$(printf '%s' "$PC_BACKEND_ORIGIN" | sed -E 's#^https?://([^/]+).*#\1#')
if [[ "$PC_BACKEND_ORIGIN" == https://* ]]; then
@@ -72,6 +74,9 @@ if command -v curl &>/dev/null && [[ -n "${PC_BACKEND_ORIGIN:-}" ]]; then
echo " PC Chat API: ${PC_VITE_CHAT_URL:-${PC_BACKEND_ORIGIN}/api/chat}"
echo " PC Admin API: ${PC_VITE_ADMIN_URL:-${PC_BACKEND_ORIGIN}/api/admin}"
echo " PC WebSocket: ${PC_VITE_WS_URL:-$default_ws_url}"
if [[ "$PC_BACKEND_ORIGIN" == https://* ]]; then
echo " PC 页面入口: ${PC_BACKEND_ORIGIN}/ (HTTPS + COOP/COEP首次访问需接受自签名证书)"
fi
echo " Nginx 日志: /var/log/nginx/openim-pc-proxy-access.log"
pc_probe_msg_gateway "$PC_BACKEND_ORIGIN"
else