This commit is contained in:
vet
2026-04-14 11:14:51 +07:00
parent 58d379ec98
commit a5c6161b71
3 changed files with 17 additions and 0 deletions

View File

@@ -259,6 +259,7 @@ pc_print_vite_backend_env() {
info " VITE_WS_URL=${VITE_WS_URL:-<empty>}"
info " VITE_CHAT_URL=${VITE_CHAT_URL:-<empty>}"
info " VITE_USER_URL=${VITE_USER_URL:-<empty>}"
info " VITE_ADMIN_URL=${VITE_ADMIN_URL:-${PC_VITE_ADMIN_URL:-<empty>}}"
}
pc_check_nginx_gateway() {

View File

@@ -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;

View File

@@ -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"