I am asking because my varnish running setup (something like the example from my previous email but with lots of routing/rewriting/caching rules) the second POST request (after a restart) sent to backend doesn't contain a valid content and the backend returns a 400. I should mention that the first POST request is "restarted" because the backend doesn't respond within 30 sec. Please find below the a sample of the apache (the backend) error log containing the the post data.
[Mon Apr 18 14:36:32 2011] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in (data-HEAP): 21 bytes [Mon Apr 18 14:36:32 2011] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in (data-HEAP): Content-Length: 249\r\n [Mon Apr 18 14:36:32 2011] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes [Mon Apr 18 14:36:32 2011] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in (data-HEAP): 23 bytes [Mon Apr 18 14:36:32 2011] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in (data-HEAP): X-Varnish: 1464392690\r\n [Mon Apr 18 14:36:32 2011] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in [getline-blocking] 0 readbytes [Mon Apr 18 14:36:32 2011] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in (data-HEAP): 2 bytes [Mon Apr 18 14:36:32 2011] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_in (data-HEAP): \r\n [Mon Apr 18 14:36:32 2011] [debug] mod_dumpio.c(103): mod_dumpio: dumpio_in [readbytes-blocking] 249 readbytes [Mon Apr 18 14:36:32 2011] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_in (metadata-EOS): 0 bytes [Mon Apr 18 14:36:32 2011] [debug] mod_deflate.c(602): [client 172.16.16.13] Zlib: Compressed 0 to 2 : URL /path2/something/else, referer: http://www.example.net/path1/something/else [Mon Apr 18 14:36:32 2011] [debug] mod_dumpio.c(129): mod_dumpio: dumpio_out [Mon Apr 18 14:36:32 2011] [debug] mod_dumpio.c(51): mod_dumpio: dumpio_out (data-HEAP): 212 bytes [Mon Apr 18 14:36:32 2011] [debug] mod_dumpio.c(67): mod_dumpio: dumpio_out (data-HEAP): HTTP/1.1 400 Bad Request\r\nDate: Mon, 18 Apr 2011 12:36:32 GMT\r\nServer: Apache\r\nVary: Accept-Encoding\r\nContent-Encoding: gzip\r\nContent-Length: 20\r\nConnection: close\r\nContent-Type: text/html; charset=iso-8859-1\r\n\r\n -- Cosmih On Mon, Apr 18, 2011 at 9:56 PM, Ken Brownfield <[email protected]> wrote: > Yes, this has been confirmed a few times on varnish-misc. I'd suggest not > restarting POST in the case of a 500 status. A 503 status (no available > Varnish backend) is debatable. Personally, I restart POSTs that receive > 503s because my app(s) don't return 503. > > FWIW, > -- > kb > > > On Mon, Apr 18, 2011 at 12:45, cosmih <[email protected]> wrote: >> >> Hello, >> >> Because I haven't found this information anywhere I would like to ask >> you if the POST content will be forwarded again in case a restart is >> involved like in the below example: >> >> sub vcl_recv { >> set req.http.ORIGINAL-REQUEST = req.url; >> if (req.url ~ "^/path1/somthing/else" ) { >> set req.url = reqsub(req.url, "/path1/(.*)$", "/path2/\1"); >> set backend = round_robin_director; >> } >> } >> >> sub vcl_fetch { >> if (beresp.status == 500 || beresp.status == 400) { >> set beresp.saintmode = 5s; >> set req.url = req.http.ORIGINAL-REQUEST; >> restart; >> } >> } >> >> sub vcl_error { >> if (obj.status == 503 && req.restarts < 6) { >> set req.url = req.http.ORIGINAL-REQUEST; >> restart; >> } >> } >> >> >> Regards, >> >> -- >> Cosmih >> >> _______________________________________________ >> varnish-misc mailing list >> [email protected] >> http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > > > _______________________________________________ > varnish-misc mailing list > [email protected] > http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > _______________________________________________ varnish-misc mailing list [email protected] http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
