reverse proxy - varnish backend VCC-compiler failed -


i want add varnish proxy infront of sx server have 2 droplets ip:192.168.0.100 ip: 192.168.0.101 both works in lan while restarting varnish shows compile error

nano /etc/varnish/default.vcl

# define our first nginx server backend nginx01 {     .host = "192.168.0.100";     .port = "80"; }  # define our second nginx server backend nginx02 {     .host = "192.168.0.101";     .port = "80"; }  # configure load balancer director nginx round-robin {     { .backend = nginx01; }     { .backend = nginx02; } }  # when request made set backend round-robin director named nginx sub vcl_recv {     set req.backend = nginx; } 

while restarting varnish shows error

root@sproxy:~# service varnish restart message vcc-compiler:  directors in directors vmod. ('input' line 30 pos 1) director nginx round-robin { ########--------------------  running vcc-compiler failed, exited 2  vcl compilation failed  * syntax check failed, not restarting 

it seems using varnish 4.0. in version directors has been moved vmods

here example based in got here:

vcl 4.0;  # define first nginx server backend nginx01 {     .host = "192.168.0.100";     .port = "80"; }  # define second nginx server backend nginx02 {     .host = "192.168.0.101";     .port = "80"; }  sub vcl_init {     new cluster1 = directors.round_robin();     cluster1.add_backend(nginx01, 1.0);     cluster1.add_backend(nginx02, 1.0); }  sub vcl_recv {     set req.backend_hint = cluster1.backend(); } 

tip: don't forget "vcl 4.0;" statement!


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -