We've been making changes to how we organize and display our docs. Our work isn't done but we'd love your feedback.
Getting started
Basics
Domains & Origins
Performance

Configuration
Basics
Conditions
Dictionaries
Domains & Origins
Request settings
Cache settings
Headers
Responses
Performance
Custom VCL
Image optimization
Video

Security
Access Control Lists
Monitoring and testing
Securing communications
TLS
Web Application Firewall

Integrations
Logging endpoints
Non-Fastly services

Diagnostics
Streaming logs
Debugging techniques
Common errors

Account info
Account management
Billing
User access and control

Reference

    Loop detection

      Last updated April 24, 2018

    Fastly automatically detects loops resulting from service configuration errors. When a loop is detected, Fastly blocks the requests and generates an error message. Loops can occur when the same hostname is configured as both the domain and the origin server, and the CNAME record for the domain is pointed at Fastly. For example, loop detection will be triggered if you set www.example.com as the domain and the origin server in your Fastly service and you add a CNAME DNS record for www.example.com that points at Fastly.

    How to avoid triggering loop detection

    To avoid triggering loop detection, you should verify the hostname of your origin server is not the same as the domain using one of the following two options:

    Example error message

    When Fastly detects a loop, an error message similar to the one displayed below will appear in the headers.

    1
    2
    3
    4
    5
    6
    7
    
    HTTP/1.1 503 Loop detected
    Error-Reason: loop detected
    Connection: close
    Content-Type: text/plain
    Fastly-Host: <hostname>
    Fastly-FF: <hostname>
    Server: Varnish
    
    Back to Top