Simplified approach with Varnish 4 method
Reverted the previous attempt and created a simplified version without variables (as declares are not accepted).
Tested on zgate1
using a /etc/hosts
entry with a non existing domain pointing to zgate1
(not the floating IP).
Unfortunately I do not know how to create the error.