Navigation

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

    Varnish - reverse proxy - backends order error

    pfSense Packages
    2
    6
    1337
    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

      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
      • marcelloc
        marcelloc last edited by

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

        1 Reply Last reply Reply Quote 0
        • B
          bzg last edited by

          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

            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
            • marcelloc
              marcelloc last edited by

              Can you take some screenshosts of your config?

              I have varnish working fine here with lb directors

              1 Reply Last reply Reply Quote 0
              • B
                bzg last edited by

                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
                • First post
                  Last post

                Products

                • Platform Overview
                • TNSR
                • pfSense
                • Appliances

                Services

                • Training
                • Professional Services

                Support

                • Subscription Plans
                • Contact Support
                • Product Lifecycle
                • Documentation

                News

                • Media Coverage
                • Press
                • Events

                Resources

                • Blog
                • FAQ
                • Find a Partner
                • Resource Library
                • Security Information

                Company

                • About Us
                • Careers
                • Partners
                • Contact Us
                • Legal
                Our Mission

                We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

                Subscribe to our Newsletter

                Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

                © 2021 Rubicon Communications, LLC | Privacy Policy