18 lines
719 B
Bash
18 lines
719 B
Bash
set +e
|
|||
|
|
F=/www/server/panel/vhost/nginx/zz-probe-scheme.conf
|
||
|
|
cat > "$F" <<'CONF'
|
||
|
|
# 临时探针(2026-09-19,用完即删):判定 CF→源站用的是 http 还是 https
|
||
|
|
server {
|
||
|
|
listen 80;
|
||
|
|
server_name ai1net.com;
|
||
|
|
location / { return 200 "SCHEME=$scheme PROTO=$server_protocol XFP=$http_x_forwarded_proto CFIP=$http_cf_connecting_ip HOSTV=$host\n"; }
|
||
|
|
}
|
||
|
|
CONF
|
||
|
|
echo "--- nginx -t ---"
|
||
|
|
nginx -t 2>&1 | tail -1
|
||
|
|
nginx -s reload 2>&1 | tail -1
|
||
|
|
sleep 1
|
||
|
|
echo "--- 本机直连 80 自测 ---"
|
||
|
|
curl -s -H "Host: ai1net.com" http://127.0.0.1/ 2>&1 | head -2
|
||
|
|
echo "--- BT catchall 443 的 root ---"
|
||
|
|
grep -nE "server_name|root |ssl_certificate" /www/server/panel/vhost/nginx/0.catchall-443.conf 2>/dev/null | head -6
|