Introduction
Fastly custom logging endpoint fails when log format is invalid or destination is unreachable. This guide provides step-by-step diagnosis and resolution with specific commands and configuration examples.
Symptoms
Typical symptoms and error messages when this issue occurs:
bash
CDN error: content not delivered
Check CDN configuration and origin server
Verify cache rules and SSL settingsObservable indicators: - CDN returns errors to end users - Content not being cached as expected - SSL or security configuration issues
Common Causes
- 1.Fastly issues are typically caused by:
- 2.VCL syntax errors or incorrect logic
- 3.Backend health check configuration issues
- 4.Cache key or stale content configuration
- 5.TLS certificate pending validation
Step-by-Step Fix
Step 1: Check Current State
bash
curl -I -H "Fastly-Debug: 1" https://example.com/pathStep 2: Identify Root Cause
bash
fastly log-tail --service-id <service-id>Step 3: Apply Primary Fix
bash
# Primary configuration fix
Cache-Control: public, max-age=86400
CDN-Cache-Control: max-age=31536000Apply this configuration in the CDN dashboard or via API.
Step 4: Apply Alternative Fix (If Needed)
bash
# Alternative fix: adjust TTL
Edge-Cache-TTL: 3600
Stale-While-Revalidate: 86400Step 5: Verify the Fix
After applying the fix, verify with:
bash
curl -I -H "Fastly-Debug: 1" https://example.com/test | grep -E "X-Served-By|X-Cache"Expected output should show proper caching headers and successful content delivery.
Common Pitfalls
- VCL subroutine not defined before use
- Backend health check path returning wrong status
- Cache key including too many query parameters
- Shielding not configured for high traffic
Best Practices
- Use VCL snippets for reusable code
- Configure shielding for high-traffic origins
- Use edge dictionaries for configuration
- Test VCL changes locally before deployment
Related Issues
- Fastly VCL Syntax Error
- Fastly Backend Health Check Failing
- Fastly Cache Stale Serving
- Fastly Rate Limiter Blocking Legitimate