Varnish vs. X-JSON header

Michael S. Fischer michael at dynamine.net
Thu Mar 27 16:39:00 CET 2008


The Transfer-Encoding: header is missing from the Varnish response as well.

--Michael

On Thu, Mar 27, 2008 at 7:55 AM, Florian Engelhardt <f.engelhardt at 21torr.com>
wrote:

> Hello,
>
> i've got a problem with the X-JSON HTTP-Header not beeing delivered by
> varnish in pipe and pass mode.
> My application runs on PHP with lighttpd, when querying the lighty
> direct (via port :81), the header is present in the request. PHP Script
> is as follows:
>
> <?php
> header('X-JSON: foobar');
> echo 'foobar';
> ?>
>
> Requesting with curl shows the following:
>
> $ curl http://server.net/test.php -D -
> HTTP/1.1 200 OK
> Expires: Fri, 28 Mar 2008 14:49:29 GMT
> Cache-Control: max-age=86400
> Content-type: text/html
> Server: lighttpd
> Content-Length: 6
> Date: Thu, 27 Mar 2008 14:49:29 GMT
> Age: 0
> Via: 1.1 varnish
> Connection: keep-alive
>
> foobar
>
>
> Requesting on port 81 (where lighty listens on):
>
> $ curl http://server.net:81/test.php-D -
> HTTP/1.1 200 OK
> Transfer-Encoding: chunked
> Expires: Fri, 28 Mar 2008 14:51:45 GMT
> Cache-Control: max-age=86400
> X-JSON: foobar
> Content-type: text/html
> Date: Thu, 27 Mar 2008 14:51:45 GMT
> Server: lighttpd
>
> foobar
>
>
> Why is this X-JSON header missing when requested via varnish?
>
> Kind Regards
>
> Flo
>
> PS: my vcl file:
>
> backend default {
>  .host = "127.0.0.1";
>  .port = "81";
> }
>
> sub vcl_recv {
>  if (req.url ~ "^/media\.php.*" || req.url == "/status/") {
>    pass;
>  }
>  if (req.url ~ "^/ADMIN.*") {
>    pipe;
>  }
>  if (req.url == "/test.php") {
>    pass;
>  }
> }
>
> # test.php entry just for testing purpose
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at projects.linpro.no
> http://projects.linpro.no/mailman/listinfo/varnish-misc
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20080327/556f7343/attachment-0001.html>


More information about the varnish-misc mailing list