How to get the current hostname in VCL?



  • Austin Spires

    Hey @analogue, try req.backend. pulls the inbound request Host header, so getting the domain for that is to be expected.

  • Cassandra Dixon

    If you are trying to get information about the origin, this help guide my be useful as well - Tracking you origin's name, ip, and port

  • analogue

    I don't think my question was clear enough =)

    If I serve with Fastly, I'd like to get "" somewhere. Not the hostname of a backend.

    I solved this by setting a new variable: set req.http.original_host =

Please sign in to leave a comment.