20 lines
1.0 KiB
Bash
20 lines
1.0 KiB
Bash
#!/bin/bash
|
|
echo "--- 1. Express on 3000 - direct test ---"
|
|
curl -o /dev/null -s -w "API direct 3000: HTTP %{http_code}\n" http://127.0.0.1:3000/api/v1/banners
|
|
curl -o /dev/null -s -w "Uploads direct 3000: HTTP %{http_code} size=%{size_download}\n" http://127.0.0.1:3000/uploads/1781403331659-1cac3cac.png
|
|
|
|
echo "--- 2. Nginx proxy test ---"
|
|
curl -o /dev/null -s -w "API nginx 80: HTTP %{http_code}\n" http://127.0.0.1:80/api/v1/banners
|
|
curl -o /dev/null -s -w "Uploads nginx 80: HTTP %{http_code} size=%{size_download}\n" http://127.0.0.1:80/uploads/1781403331659-1cac3cac.png
|
|
|
|
echo "--- 3. Check if Express is actually listening ---"
|
|
ss -tlnp 2>/dev/null | grep 3000
|
|
echo "--- 4. List of PM2 processes ---"
|
|
ps -ef | grep -E "pm2|node" | grep -v grep | head -5
|
|
|
|
echo "--- 5. Check what openresty config is reading ---"
|
|
cat /etc/nginx/sites-enabled/yuyueguahao | grep -A1 "location /uploads"
|
|
cat /etc/nginx/sites-enabled/yuyueguahao | grep -A1 "location /api"
|
|
echo "--- 6. Error log fresh ---"
|
|
tail -5 /var/log/nginx/error.log
|