Varnish - reverse proxy - backends order error



  • Dear members,

    I've problem with configuring varnish domain name based reverse proxy and I didn't found the solution in the last few days. I've the following configuration:

    • 2.1.2-RELEASE (amd64)
    • Varnish3, 3.0.4 pkg v.0.2.1
    • 1 public IP
    • 2 domains in the intranet (10.0.0.15 and 10.0.0.50)
    • varnish configured with two backends:
      – Backend1, ip 10.0.0.15, port 80, Map: host equals domain1.com grace 0
      -- Backend2, ip 10.0.0.50, port 80, Map: host equals domain2.com grace 0

    The problem is that every time the first backend is showed in the browser, so if look for domain2.com then the domain1.com is showed. If I delete both backends and recreate in reverse order (Backend2 and Backend1) then domain2.com is showed even if I'm looking for domain1.com.

    What's wrong in my configuration? Any ideas?

    Best Regards,
    bzg



  • Try with lbdirectors.
    Also if you know about varnish config, you can check if package gui is creating wrong config files.



  • Unfortunately I don't know varnish, we are using nginx for every reverse proxy, web server purpose. But now I had to do domain name based reverse proxy with pfsense. I'll check that lbdirectors.



  • I tried with lbdirector, but I got errors like:

    php: /status_services.php: The command '/usr/local/etc/rc.d/varnish.sh stop' returned exit code '2', the output was 'kern.ipc.somaxconn: 16384 -> 16384 kern.maxfiles: 131072 -> 131072 kern.maxfilesperproc: 104856 -> 104856 kern.threads.max_threads_per_proc: 4096 -> 4096 Message from VCC-compiler: Reference to unknown backend 'BACKEND' at ('input' Line 34 Pos 28) .backend = BACKEND; –-------------------------#######- In director specification starting at: ('input' Line 32 Pos 1) director LBD01 round-robin { ########------------------------ Running VCC-compiler failed, exit 1 VCL compilation failed'



  • Can you take some screenshosts of your config?

    I have varnish working fine here with lb directors



  • Okay, so I reinstalled the varnish3 package, but I got this error in logs:

    php: /pkg_mgr_install.php: The command '/usr/local/etc/rc.d/varnish.sh' returned exit code '2', the output was 'kern.ipc.somaxconn: 16384 -> 16384 kern.maxfiles: 131072 -> 131072 kern.maxfilesperproc: 104856 -> 104856 kern.threads.max_threads_per_proc: 4096 -> 4096 Message from VCC-compiler: Reference to unknown backend 'BACKEND' at ('input' Line 34 Pos 28) .backend = BACKEND; –-------------------------#######- In director specification starting at: ('input' Line 32 Pos 1) director LBD01 round-robin { ########-------------------- Running VCC-compiler failed, exit 1 VCL compilation failed'

    I give up this package in my point of view is very alpha.


Log in to reply