From a5c6161b71223c495b2b0d87dcf2352b773ee5b3 Mon Sep 17 00:00:00 2001 From: vet Date: Tue, 14 Apr 2026 11:14:51 +0700 Subject: [PATCH] test --- common.sh | 1 + nginx/openim-pc-proxy.conf | 12 ++++++++++++ status.sh | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/common.sh b/common.sh index 136d661..ac10e9f 100755 --- a/common.sh +++ b/common.sh @@ -259,6 +259,7 @@ pc_print_vite_backend_env() { info " VITE_WS_URL=${VITE_WS_URL:-}" info " VITE_CHAT_URL=${VITE_CHAT_URL:-}" info " VITE_USER_URL=${VITE_USER_URL:-}" + info " VITE_ADMIN_URL=${VITE_ADMIN_URL:-${PC_VITE_ADMIN_URL:-}}" } pc_check_nginx_gateway() { diff --git a/nginx/openim-pc-proxy.conf b/nginx/openim-pc-proxy.conf index 1a0458a..8ccf3db 100644 --- a/nginx/openim-pc-proxy.conf +++ b/nginx/openim-pc-proxy.conf @@ -68,6 +68,18 @@ server { proxy_send_timeout 300s; } + # Admin API → admin-api :10009 + location /api/admin/ { + proxy_pass http://127.0.0.1:10009/; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 300s; + proxy_send_timeout 300s; + } + # MsgGateway WebSocket → openim-server :10001 location ^~ /msg_gateway { proxy_pass http://127.0.0.1:10001; diff --git a/status.sh b/status.sh index 2717232..89fe716 100755 --- a/status.sh +++ b/status.sh @@ -67,6 +67,10 @@ if command -v curl &>/dev/null && [[ -n "${PC_BACKEND_ORIGIN:-}" ]]; then else default_ws_url="ws://${gateway_host}/msg_gateway" fi + echo " PC IM API: ${PC_VITE_API_URL:-${PC_BACKEND_ORIGIN}/api/im}" + echo " PC User API: ${PC_VITE_USER_URL:-${PC_BACKEND_ORIGIN}/api/user}" + 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}" else printf " ${YELLOW}○${NC} %-14s %s\n" "nginx-health" "跳过(未安装 curl 或未设置 PC_BACKEND_ORIGIN)"