Question

I have the following configuration:

apache:80 -> varnish:8080 -> apache:81 -> thin:9070

That worked fine with apache 2.2, but apache 2.4 I keep getting 400 Bad Request.

The varnishlog follows:

➜  ~  varnishlog
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1383139919 1.0
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1383139922 1.0
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1383139925 1.0
   13 SessionOpen  c 201.8.255.45 38752 :8080
   13 ReqStart     c 201.8.255.45 38752 1838475349
   13 RxRequest    c GET
   13 RxURL        c /
   13 RxProtocol   c HTTP/1.1
   13 RxHeader     c Host: escambo.org.br:8080
   13 RxHeader     c Connection: keep-alive
   13 RxHeader     c Cache-Control: max-age=0
   13 RxHeader     c Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
   13 RxHeader     c User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/29.0.1547.76 Chrome/29.0.1547.76 Safari/537.36
   13 RxHeader     c DNT: 1
   13 RxHeader     c Accept-Encoding: gzip,deflate,sdch
   13 RxHeader     c Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4
   13 RxHeader     c Cookie: _noosfero_session=fdb69fb023c5b4f23578041a7e1ae390; active_organization=6
   13 VCL_call     c recv
   13 VCL_return   c pass
   13 VCL_call     c hash
   13 VCL_return   c hash
   13 VCL_call     c pass
   13 VCL_return   c pass
   14 BackendOpen  b default 127.0.0.1 34279 127.0.0.1 81
   13 Backend      c 14 default default
   14 TxRequest    b GET
   14 TxURL        b /
   14 TxProtocol   b HTTP/1.1
   14 TxHeader     b Host: escambo.org.br:8080
   14 TxHeader     b Cache-Control: max-age=0
   14 TxHeader     b Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
   14 TxHeader     b User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/29.0.1547.76 Chrome/29.0.1547.76 Safari/537.36
   14 TxHeader     b DNT: 1
   14 TxHeader     b Accept-Encoding: gzip,deflate,sdch
   14 TxHeader     b Accept-Language: pt-BR
   14 TxHeader     b Cookie: _noosfero_session=fdb69fb023c5b4f23578041a7e1ae390; active_organization=6
   14 TxHeader     b X-Varnish-Accept-Language: pt
   14 TxHeader     b X-Forwarded-For: 201.8.255.45
   14 TxHeader     b X-Varnish: 1838475349
   14 RxProtocol   b HTTP/1.1
   14 RxStatus     b 400
   14 RxResponse   b Bad Request
   14 RxHeader     b Date: Wed, 30 Oct 2013 13:32:06 GMT
   14 RxHeader     b Server: Apache/2.4.6 (Ubuntu)
   14 RxHeader     b Content-Length: 306
   14 RxHeader     b Connection: close
   14 RxHeader     b Content-Type: text/html; charset=iso-8859-1
   13 TTL          c 1838475349 RFC 120 1383139926 0 0 0 0
   13 VCL_call     c fetch
   13 VCL_return   c pass
   13 ObjProtocol  c HTTP/1.1
   13 ObjStatus    c 400
   13 ObjResponse  c Bad Request
   13 ObjHeader    c Date: Wed, 30 Oct 2013 13:32:06 GMT
   13 ObjHeader    c Server: Apache/2.4.6 (Ubuntu)
   13 ObjHeader    c Content-Length: 306
   13 ObjHeader    c Content-Type: text/html; charset=iso-8859-1
   13 ObjHeader    c Vary: X-Varnish-Accept-Language
   14 Fetch_Body   b 4 0 1
   14 Length       b 306
   14 BackendClose b default
   13 VCL_call     c deliver
   13 VCL_return   c deliver
   13 TxProtocol   c HTTP/1.1
   13 TxStatus     c 400
   13 TxResponse   c Bad Request
   13 TxHeader     c Server: Apache/2.4.6 (Ubuntu)
   13 TxHeader     c Content-Type: text/html; charset=iso-8859-1
   13 TxHeader     c Vary: X-Varnish-Accept-Language
   13 TxHeader     c Content-Length: 306
   13 TxHeader     c Date: Wed, 30 Oct 2013 13:32:06 GMT
   13 TxHeader     c X-Varnish: 1838475349
   13 TxHeader     c Age: 0
   13 TxHeader     c Via: 1.1 varnish
   13 TxHeader     c Connection: keep-alive
   13 Length       c 306
   13 ReqEnd       c 1838475349 1383139926.780520439 1383139926.781727314 0.000143051 0.001113653 0.000093222
   13 Debug        c "herding"
   13 ReqStart     c 201.8.255.45 38752 1838475350
   13 RxRequest    c GET
   13 RxURL        c /favicon.ico
   13 RxProtocol   c HTTP/1.1
   13 RxHeader     c Host: escambo.org.br:8080
   13 RxHeader     c Connection: keep-alive
   13 RxHeader     c Accept: */*
   13 RxHeader     c DNT: 1
   13 RxHeader     c User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/29.0.1547.76 Chrome/29.0.1547.76 Safari/537.36
   13 RxHeader     c Accept-Encoding: gzip,deflate,sdch
   13 RxHeader     c Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4
   13 RxHeader     c Cookie: _noosfero_session=fdb69fb023c5b4f23578041a7e1ae390; active_organization=6
   13 VCL_call     c recv
   13 VCL_return   c pass
   13 VCL_call     c hash
   13 VCL_return   c hash
   13 VCL_call     c pass
   13 VCL_return   c pass
   14 BackendOpen  b default 127.0.0.1 34280 127.0.0.1 81
   13 Backend      c 14 default default
   14 TxRequest    b GET
   14 TxURL        b /favicon.ico
   14 TxProtocol   b HTTP/1.1
   14 TxHeader     b Host: escambo.org.br:8080
   14 TxHeader     b Accept: */*
   14 TxHeader     b DNT: 1
   14 TxHeader     b User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/29.0.1547.76 Chrome/29.0.1547.76 Safari/537.36
   14 TxHeader     b Accept-Encoding: gzip,deflate,sdch
   14 TxHeader     b Accept-Language: pt-BR
   14 TxHeader     b Cookie: _noosfero_session=fdb69fb023c5b4f23578041a7e1ae390; active_organization=6
   14 TxHeader     b X-Varnish-Accept-Language: pt
   14 TxHeader     b X-Forwarded-For: 201.8.255.45
   14 TxHeader     b X-Varnish: 1838475350
   14 RxProtocol   b HTTP/1.1
   14 RxStatus     b 400
   14 RxResponse   b Bad Request
   14 RxHeader     b Date: Wed, 30 Oct 2013 13:32:07 GMT
   14 RxHeader     b Server: Apache/2.4.6 (Ubuntu)
   14 RxHeader     b Content-Length: 306
   14 RxHeader     b Connection: close
   14 RxHeader     b Content-Type: text/html; charset=iso-8859-1
   13 TTL          c 1838475350 RFC 120 1383139927 0 0 0 0
   13 VCL_call     c fetch
   13 VCL_return   c pass
   13 ObjProtocol  c HTTP/1.1
   13 ObjStatus    c 400
   13 ObjResponse  c Bad Request
   13 ObjHeader    c Date: Wed, 30 Oct 2013 13:32:07 GMT
   13 ObjHeader    c Server: Apache/2.4.6 (Ubuntu)
   13 ObjHeader    c Content-Length: 306
   13 ObjHeader    c Content-Type: text/html; charset=iso-8859-1
   13 ObjHeader    c Vary: X-Varnish-Accept-Language
   14 Fetch_Body   b 4 0 1
   14 Length       b 306
   14 BackendClose b default
   13 VCL_call     c deliver
   13 VCL_return   c deliver
   13 TxProtocol   c HTTP/1.1
   13 TxStatus     c 400
   13 TxResponse   c Bad Request
   13 TxHeader     c Server: Apache/2.4.6 (Ubuntu)
   13 TxHeader     c Content-Type: text/html; charset=iso-8859-1
   13 TxHeader     c Vary: X-Varnish-Accept-Language
   13 TxHeader     c Content-Length: 306
   13 TxHeader     c Date: Wed, 30 Oct 2013 13:32:07 GMT
   13 TxHeader     c X-Varnish: 1838475350
   13 TxHeader     c Age: 0
   13 TxHeader     c Via: 1.1 varnish
   13 TxHeader     c Connection: keep-alive
   13 Length       c 306
   13 ReqEnd       c 1838475350 1383139927.131367445 1383139927.132475853 0.349640131 0.000998974 0.000109434
   13 Debug        c "herding"
    0 CLI          - Rd ping
    0 CLI          - Wr 200 19 PONG 1383139928 1.0
➜  ~ 

The access.log doesn't show any detail on the problem.

Was it helpful?

Solution

The problem was to the use of an old version of https://github.com/cosimo/varnish-accept-language. Updating it solved!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top