Is there a way to specify a weight for a backend in Varnish? I need to be able to serve different page if my main backend is unaccessable.
If you have varnish in front of a single backend, you can define the 503 page that is displayed when the backend isn't reachable. You could increase your grace time so that you serve old content if the backend fails.
If you have varnish in front of two backends, you can define a director with healthchecks that will remove the bad backend, leaving the other backend responding.
You can also intercept the 503 to report a page from a separate backend that has a static page. The directors don't really support weights, but since VCL is just compiled C code, there really isn't much you can't do. You can see if the beresp object is an error and select a different backend, perhaps the one for your error message.
Unless you're running varnish in front of a webfarm, putting the 503 page in Varnish is probably the easiest.