aivarsk / libvmod-rewrite

Varnish vmod for rewriting HTML content.
GNU General Public License v3.0
18 stars 5 forks source link

Cache hits return null objects #3

Open barryrobison opened 8 years ago

barryrobison commented 8 years ago

Rewrite works fine on the first hit, but if a TTL is set then cache hits cause a 502 BAD_GATEWAY response.

VCL looks like

sub vcl_deliver { if ( obj.hits == 0 && req.http.host == "blog.staging.wpengine.com" ) { rewrite.rewrite_re("blog.staging.wpengine.com", req.http.orighost+"/blog"); rewrite.rewrite_re({""/wp-content"}, {""/blog/wp-content"}); rewrite.rewrite_re({"'/wp-content"}, {"'/blog/wp-content"}); } }

barryrobison commented 8 years ago

Tested against 3.0.5 and 3.0.7.