Files
2026-07-05 14:43:34 +08:00

13 lines
855 B
Bash

#!/bin/bash
echo "--- Test: what does nginx see? ---"
echo "--- Express handler for unknown route ---"
curl -v http://127.0.0.1:3000/api/v1/banners 2>&1 | grep -E "HTTP|Server|Content-Type" | head -3
echo "--- Test with Host header ---"
curl -v -H "Host: 124.221.67.199" http://127.0.0.1:3000/api/v1/banners 2>&1 | grep -E "HTTP|< " | head -5
echo "--- Test with X-Forwarded-Proto header (like nginx sends) ---"
curl -v -H "Host: 124.221.67.199" -H "X-Forwarded-Proto: http" -H "X-Real-IP: 1.2.3.4" http://127.0.0.1:3000/api/v1/banners 2>&1 | grep -E "HTTP|< " | head -5
echo "--- Test Express trust proxy setting ---"
grep -E "trust.proxy|app.set" /opt/yuyueguahao/server/src/index.js | head -5
echo "--- Curl the configured express IP directly ---"
curl -v -H "Host: localhost" http://127.0.0.1:3000/api/v1/banners 2>&1 | grep -E "HTTP|< |^>" | head -8