Skip to content

Commit 1957dc8

Browse files
cfsmp3claude
authored andcommitted
fix: Add -L flag to curl to follow HTTP->HTTPS redirects
The health check was failing with 301 because nginx redirects HTTP to HTTPS. Adding -L makes curl follow the redirect and get the actual health endpoint response. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8b46ef5 commit 1957dc8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

install/deploy/post_deploy.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ echo "--- Health check ---"
3131
for i in $(seq 1 $MAX_RETRIES); do
3232
echo "Attempt $i/$MAX_RETRIES..."
3333

34-
# Try the /health endpoint first
35-
HTTP_CODE=$(curl -s -o /tmp/health_response.json -w "%{http_code}" "$HEALTH_URL" 2>/dev/null || echo "000")
34+
# Try the /health endpoint first (use -L to follow HTTP->HTTPS redirects)
35+
HTTP_CODE=$(curl -sL -o /tmp/health_response.json -w "%{http_code}" "$HEALTH_URL" 2>/dev/null || echo "000")
3636

3737
if [ "$HTTP_CODE" = "200" ]; then
3838
echo "✓ Health check passed (HTTP $HTTP_CODE)"
@@ -43,9 +43,9 @@ for i in $(seq 1 $MAX_RETRIES); do
4343
echo "=== Deployment verified successfully ==="
4444
exit 0
4545
elif [ "$HTTP_CODE" = "404" ]; then
46-
# Health endpoint doesn't exist, try fallback
46+
# Health endpoint doesn't exist, try fallback (use -L to follow redirects)
4747
echo "Health endpoint not found, trying fallback URL..."
48-
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$FALLBACK_URL" 2>/dev/null || echo "000")
48+
HTTP_CODE=$(curl -sL -o /dev/null -w "%{http_code}" "$FALLBACK_URL" 2>/dev/null || echo "000")
4949
if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 400 ]; then
5050
echo "✓ Fallback check passed (HTTP $HTTP_CODE)"
5151
echo ""

0 commit comments

Comments
 (0)