diff --git a/nginx/openim-pc-proxy.conf b/nginx/openim-pc-proxy.conf index 8ccf3db..bee6718 100644 --- a/nginx/openim-pc-proxy.conf +++ b/nginx/openim-pc-proxy.conf @@ -18,12 +18,21 @@ map $http_upgrade $connection_upgrade { '' close; } +log_format openim_pc_gateway + '$remote_addr - $host [$time_local] "$request" status=$status bytes=$body_bytes_sent ' + 'upgrade="$http_upgrade" connection="$http_connection" ' + 'upstream="$upstream_addr" upstream_status="$upstream_status" ' + 'upstream_time="$upstream_response_time" request_time="$request_time" ' + 'referer="$http_referer" ua="$http_user_agent"'; + server { listen 80 default_server; listen [::]:80 default_server; server_name _; client_max_body_size 100m; + access_log /var/log/nginx/openim-pc-proxy-access.log openim_pc_gateway; + error_log /var/log/nginx/openim-pc-proxy-error.log warn; # 根路径:不托管前端;避免与其它站点抢 default_server 后仍误以为是 CMS location = / { diff --git a/status.sh b/status.sh index 5d3c0f0..23280a1 100755 --- a/status.sh +++ b/status.sh @@ -72,6 +72,7 @@ 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}" + echo " Nginx 日志: /var/log/nginx/openim-pc-proxy-access.log" pc_probe_msg_gateway "$PC_BACKEND_ORIGIN" else printf " ${YELLOW}○${NC} %-14s %s\n" "nginx-health" "跳过(未安装 curl 或未设置 PC_BACKEND_ORIGIN)"