Varnish backend request sent to itself?

Martynas Jusevičius martynas at
Wed Mar 18 10:36:55 UTC 2020


I'm using varnish-5.2.1 revision 67e562482 as a Docker image and
trying to restore the setup that was working some time ago.

However I'm getting 503 Backend fetch failed.

The VCL file clearly specifies the backend:

backend default {
    .host = "";
    .port = "80";
    .first_byte_timeout = 60s;

Varnish itself runs on atomgraph.some_host.varnish, as specified in

When I login into the container, I see the client request:

-   ReqMethod      GET
-   ReqURL         /smth/smth/...
-   ReqProtocol    HTTP/1.1
-   ReqHeader      Accept:
-   ReqHeader      Cache-Control: no-cache
-   ReqHeader      Authorization: Basic bGlua2VkZGF0YWh1YjpqYThhc3BhdHV0YWtFdGhV
-   ReqHeader      Host: atomgraph.dydra.varnish
-   ReqHeader      Connection: Keep-Alive
-   ReqHeader      User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
-   ReqHeader      X-Forwarded-For:

However when I look at the backend request:

-   BereqMethod    GET
-   BereqURL       /smth/smth/...
-   BereqProtocol  HTTP/1.1
-   BereqHeader    Accept:
-   BereqHeader    Authorization: Basic bGlua2VkZGF0YWh1YjpqYThhc3BhdHV0YWtFdGhV
-   BereqHeader    Host: atomgraph.dydra.varnish
-   BereqHeader    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
-   BereqHeader    X-Forwarded-For:
-   BereqHeader    X-Varnish: 32783

it looks like it is calling itself (i.e. the local fake .varnish
backend host instead of the real .com one), judging from the
BereqHeader Host.

If that is the case, then no wonder that the backend request fails:

-   BerespProtocol HTTP/1.1
-   BerespStatus   503
-   BerespReason   Service Unavailable
-   BerespReason   Backend fetch failed

How can this be?


More information about the varnish-misc mailing list