title: Varnish - HTTP/1.0 response served as HTTP/1.1
body: <p>I am trying to get HTTP 1.0 response for this request:</p>
  
  <pre><code> curl -v -A "VLSub" -0 http://api.opensubtitles.org/xml-rpc
  *   Trying 92.240.234.122...
  * Connected to api.opensubtitles.org (92.240.234.122) port 80 (#0)
  &gt; GET /xml-rpc HTTP/1.0
  &gt; Host: api.opensubtitles.org
  &gt; User-Agent: VLSub
  &gt; Accept: */*
  &gt; 
  &lt; HTTP/1.1 200 OK
  &lt; Access-Control-Allow-Origin: *
  &lt; Access-Control-Allow-Methods: GET, POST, OPTIONS
  &lt; Access-Control-Allow-Headers: Origin,X-Requested-With,Content-Type,Accept,DNT,Keep-Alive,User-Agent,If-Modified-Since,Cache-Control
  &lt; Content-type: text/xml;charset=UTF-8
  &lt; Date: Mon, 31 Oct 2016 04:19:36 GMT
  &lt; X-Cache-Backend: web2
  &lt; X-Cache: MISS
  &lt; Accept-Ranges: bytes
  &lt; Content-Length: 305
  &lt; Connection: close
  &lt; Age: 0
  &lt; 
  * Closing connection 0
  [data]
  </code></pre>
  
  <p>varnishd (varnish-4.1.3 revision 5e3b6d2):</p>
  
  <pre><code>*   &lt;&lt; BeReq    &gt;&gt; 399913921 
  -   Begin          bereq 399913920 pass
  -   Timestamp      Start: 1477887576.236176 0.000000 0.000000
  -   BereqMethod    GET
  -   BereqURL       /xml-rpc
  -   BereqProtocol  HTTP/1.0
  -   BereqHeader    Host: api.opensubtitles.org
  -   BereqHeader    User-Agent: VLSub
  -   BereqHeader    Accept: */*
  -   BereqHeader    If-Modified-Since: Mon, 31 Oct 2016 04:18:26 GMT
  -   BereqHeader    Cache-Control: max-stale=0
  -   BereqHeader    X-Forwarded-For: x.x.x.x
  -   BereqHeader    X-Varnish: 399913921
  -   VCL_call       BACKEND_FETCH
  -   VCL_return     fetch
  -   BackendOpen    922 14.web2 172.20.100.2 80 172.20.10.253 60531
  -   BackendStart   172.20.100.2 80
  -   Timestamp      Bereq: 1477887576.236208 0.000032 0.000032
  -   Timestamp      Beresp: 1477887576.244435 0.008259 0.008227
  -   BerespProtocol HTTP/1.0
  -   BerespStatus   200
  -   BerespReason   OK
  -   BerespHeader   Access-Control-Allow-Origin: *
  -   BerespHeader   Access-Control-Allow-Methods: GET, POST, OPTIONS
  -   BerespHeader   Access-Control-Allow-Headers: Origin,X-Requested-With,Content-Type,Accept,DNT,Keep-Alive,User-Agent,If-Modified-Since,Cache-Control
  -   BerespHeader   Content-type: text/xml;charset=UTF-8
  -   BerespHeader   Content-Length: 305
  -   BerespHeader   Connection: close
  -   BerespHeader   Date: Mon, 31 Oct 2016 04:19:36 GMT
  -   BerespHeader   Server: Lighttpd 1.4.x
  -   TTL            RFC 120 10 -1 1477887576 1477887576 1477887576 0 0
  -   VCL_call       BACKEND_RESPONSE
  -   BerespUnset    Server: Lighttpd 1.4.x
  -   BerespHeader   X-Cache-Backend: web2
  -   TTL            VCL 120 10 0 1477887576
  -   VCL_return     deliver
  -   Storage        malloc Transient
  -   ObjProtocol    HTTP/1.0
  -   ObjStatus      200
  -   ObjReason      OK
  -   ObjHeader      Access-Control-Allow-Origin: *
  -   ObjHeader      Access-Control-Allow-Methods: GET, POST, OPTIONS
  -   ObjHeader      Access-Control-Allow-Headers: Origin,X-Requested-With,Content-Type,Accept,DNT,Keep-Alive,User-Agent,If-Modified-Since,Cache-Control
  -   ObjHeader      Content-type: text/xml;charset=UTF-8
  -   ObjHeader      Content-Length: 305
  -   ObjHeader      Date: Mon, 31 Oct 2016 04:19:36 GMT
  -   ObjHeader      X-Cache-Backend: web2
  -   Fetch_Body     3 length stream
  -   BackendClose   922 14.web2
  -   Timestamp      BerespBody: 1477887576.244481 0.008305 0.000046
  -   Length         305
  -   BereqAcct      218 0 218 373 305 678
  -   End   
  </code></pre>
  
  <p>Added Varnish response (upgraded Varnish to 5.0.0)</p>
  
  <pre><code># varnishlog -q "ReqHeader ~ 'xxx.6.249.201' and ReqHeader ~ 'VLSub'"
  *   &lt;&lt; Request  &gt;&gt; 983658552 
  -   Begin          req 983658551 rxreq
  -   Timestamp      Start: 1478109092.896425 0.000000 0.000000
  -   Timestamp      Req: 1478109092.896425 0.000000 0.000000
  -   ReqStart       xxx.6.249.201 60135
  -   ReqMethod      GET
  -   ReqURL         /xml-rpc
  -   ReqProtocol    HTTP/1.0
  -   ReqHeader      Host: api.opensubtitles.org
  -   ReqHeader      User-Agent: VLSub
  -   ReqHeader      Accept: */*
  -   ReqHeader      If-Modified-Since: Wed, 02 Nov 2016 17:47:21 GMT
  -   ReqHeader      Cache-Control: max-stale=0
  -   ReqHeader      Connection: Keep-Alive
  -   ReqHeader      X-Forwarded-For: xxx.6.249.201
  -   VCL_call       RECV
  -   VCL_return     pass
  -   VCL_call       HASH
  -   VCL_return     lookup
  -   VCL_call       PASS
  -   VCL_return     fetch
  -   Link           bereq 983658553 pass
  -   Timestamp      Fetch: 1478109092.904685 0.008260 0.008260
  -   RespProtocol   HTTP/1.0
  -   RespStatus     200
  -   RespReason     OK
  -   RespHeader     Access-Control-Allow-Origin: *
  -   RespHeader     Access-Control-Allow-Methods: GET, POST, OPTIONS
  -   RespHeader     Access-Control-Allow-Headers: Origin,X-Requested-With,Content-Type,Accept,DNT,Keep-Alive,User-Agent,If-Modified-Since,Cache-Control
  -   RespHeader     Content-type: text/xml;charset=UTF-8
  -   RespHeader     Content-Length: 305
  -   RespHeader     Date: Wed, 02 Nov 2016 17:51:32 GMT
  -   RespHeader     X-Cache-Backend: web3
  -   RespUnset      HTTP/1.0
  -   RespProtocol   HTTP/1.1
  -   RespHeader     X-Varnish: 983658552
  -   RespHeader     Age: 0
  -   RespHeader     Via: 1.1 varnish (Varnish/5.0)
  -   VCL_call       DELIVER
  -   RespHeader     X-Cache: MISS
  -   RespUnset      X-Varnish: 983658552
  -   RespUnset      Via: 1.1 varnish (Varnish/5.0)
  -   VCL_return     deliver
  -   Timestamp      Process: 1478109092.904700 0.008274 0.000014
  -   RespHeader     Accept-Ranges: bytes
  -   Debug          "RES_MODE 2"
  -   RespHeader     Connection: keep-alive
  -   Timestamp      Resp: 1478109092.904718 0.008292 0.000018
  -   ReqAcct        188 0 188 422 305 727
  -   End    
  </code></pre>
  
  <p>it should work. But why curl is getting HTTP 1.1 response? I see Varnish is serving HTTP/1.0 responses. Thanks with any help</p>