Upgrading v3 -> v4; vcl check fails @ req.backend . What have I missed?

grantksupport at operamail.com grantksupport at operamail.com
Sun May 4 18:04:15 CEST 2014


Hi,

I've upgraded from Varnish 3 -> 4, and am working on converting my VCL,
following 

	"Upgrading to Varnish 4"
	 https://www.varnish-cache.org/docs/trunk/whats-new/upgrading.html

After making changes as I've understood them, I thing I've gotten most
right, but on config file check, I still get a fail,

	varnishd -C -f vcl.SITE.conf 
	Message from VCC-compiler:
	Unknown variable 'req.backend'
	At: ('input' Line 94 Pos 81)
	                if     (req.url ~
	                "\.(css|css?.*|woff|eot|svg|ttf|otf)$") { set
	                req.backend = css_SITE1; }
	--------------------------------------------------------------------------------###########-------------------------

	Running VCC-compiler failed, exit 1

	VCL compilation failed


I've likely missed/misunderstood a required change :-/

Here's the relevant snip from my config

		...

	    backend def_SITE1 { .port = "10100"; include
	    "/usr/local/etc/varnish/backend_common.vcl"; }
	    backend css_SITE1 { .port = "10101"; include
	    "/usr/local/etc/varnish/backend_common.vcl"; }
	    backend  js_SITE1 { .port = "10102"; include
	    "/usr/local/etc/varnish/backend_common.vcl"; }
	    backend img_SITE1 { .port = "10103"; include
	    "/usr/local/etc/varnish/backend_common.vcl"; }

	    backend def_FALLBACK   { .port = "9999"; include
	    "/usr/local/etc/varnish/backend_common.vcl"; }

	sub hostname_normalize {
	    if (req.http.host == "www.mydomain.net"  )              {
	    set req.http.host =   "mydomain.net"; }

	sub backend_assign {
	    if (req.http.host == "mydomain.net" ) {
94              if     (req.url ~
"\.(css|css?.*|woff|eot|svg|ttf|otf)$") { set req.backend = css_SITE1; }
	        elseif (req.url ~ "\.(js|js?.*)$"                      
	        ) { set req.backend =  js_SITE1; }
	        elseif (req.url ~ "\.(jp(e?)g|gif|png|ti(f?)f)$"       
	        ) { set req.backend = img_SITE1; }
	        else                                                    
	         { set req.backend = def_SITE1; }
	    }

	...

What's "req.backend" need to be changed to?

Grant



More information about the varnish-misc mailing list