• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Varnish - reverse proxy - backends order error

Scheduled Pinned Locked Moved pfSense Packages
6 Posts 2 Posters 1.6k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B
    bzg
    last edited by Apr 13, 2014, 11:47 AM

    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

    1 Reply Last reply Reply Quote 0
    • M
      marcelloc
      last edited by Apr 14, 2014, 2:44 AM

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

      Treinamentos de Elite: http://sys-squad.com

      Help a community developer! ;D

      1 Reply Last reply Reply Quote 0
      • B
        bzg
        last edited by Apr 14, 2014, 6:19 AM

        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.

        1 Reply Last reply Reply Quote 0
        • B
          bzg
          last edited by Apr 14, 2014, 6:29 AM

          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'

          1 Reply Last reply Reply Quote 0
          • M
            marcelloc
            last edited by Apr 14, 2014, 2:23 PM

            Can you take some screenshosts of your config?

            I have varnish working fine here with lb directors

            Treinamentos de Elite: http://sys-squad.com

            Help a community developer! ;D

            1 Reply Last reply Reply Quote 0
            • B
              bzg
              last edited by Apr 16, 2014, 8:39 AM

              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.

              1 Reply Last reply Reply Quote 0
              6 out of 6
              • First post
                6/6
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                This community forum collects and processes your personal information.
                consent.not_received