set +e
R=/www/server/nginx/html
echo "=== [Q1] 放置探针到默认 80 根 ==="
mkdir -p "$R/.well-known/acme-challenge" 2>/dev/null
echo "MARKER-AI1NET-OK" > "$R/probe-ai1net.txt"
echo "ACME-TOKEN-OK" > "$R/.well-known/acme-challenge/probe-token"
ls -l "$R/probe-ai1net.txt" "$R/.well-known/acme-challenge/probe-token" 2>/dev/null | awk '{print $5, $9}'
echo "=== [Q2] 0.default.conf 全文 ==="
cat /www/server/panel/vhost/nginx/0.default.conf 2>/dev/null | head -40
echo "=== [Q3] well-known 目录 ==="
ls -la /www/server/panel/vhost/nginx/well-known/ 2>/dev/null | head -10
echo "=== [Q4] 本机自测(Host=ai1net.com) ==="
curl -s -H "Host: ai1net.com" http://127.0.0.1/probe-ai1net.txt 2>&1 | head -2
curl -s -o /dev/null -w "acme probe => %{http_code}\n" -H "Host: ai1net.com" http://127.0.0.1/.well-known/acme-challenge/probe-token 2>&1 | tail -1
echo "=== [Q5] 本机自测(Host=alotbuy.com 对照) ==="
curl -s -o /dev/null -w "alotbuy 门户 => %{http_code}\n" -H "Host: alotbuy.com" http://127.0.0.1/ 2>&1 | tail -1
curl -s -H "Host: alotbuy.com" http://127.0.0.1/probe-ai1net.txt 2>&1 | head -2