Skip to content

Commit 85705cd

Browse files
committed
startup: log detailed nginx -t output for App Service diagnostics
1 parent 265a506 commit 85705cd

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

startup.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,22 @@ cat /usr/share/nginx/html/runtime-config.js
5858
echo "� File permissions after writing:"
5959
ls -la /usr/share/nginx/html/runtime-config.js
6060

61-
# DEBUG: Test file can be read by nginx user
62-
echo "🔍 Testing nginx config:"
63-
nginx -t 2>/dev/null && echo "✅ Nginx config valid" || echo "❌ Nginx config error"
61+
# DEBUG: Test nginx config and capture detailed stderr so App Service logs show
62+
# the precise error (helpful when nginx silently fails at startup in the platform).
63+
echo "🔍 Testing nginx config (detailed output will be saved to /tmp/nginx-test.log):"
64+
# Run nginx -t and capture stderr to a file we can print; preserve exit code
65+
nginx -t 2>/tmp/nginx-test.log || true
66+
echo "--- nginx -t stderr (/tmp/nginx-test.log) ---"
67+
if [ -s /tmp/nginx-test.log ]; then
68+
sed -n '1,200p' /tmp/nginx-test.log || true
69+
else
70+
echo "(no nginx test output)"
71+
fi
72+
if nginx -t >/dev/null 2>&1; then
73+
echo "✅ Nginx config valid"
74+
else
75+
echo "❌ Nginx config error (see /tmp/nginx-test.log above)"
76+
fi
6477

6578
# CRITICAL: Verify the VITE_NODE_ENV was written correctly
6679
echo "🔍 CRITICAL CHECK - Verifying VITE_NODE_ENV in file:"

0 commit comments

Comments
 (0)