The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Varnish Issues with Multiple IPs

Discussion in 'General Discussion' started by grayloon, Jan 3, 2014.

  1. grayloon

    grayloon Well-Known Member

    Joined:
    Oct 31, 2007
    Messages:
    98
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Evansville, IN
    cPanel Access Level:
    Root Administrator
    Twitter:
    I've had varnish running port 80 in front of apache running on port 8080 for 18 months. Last night, varnish just died. The only changes I made were the addition of some IP addresses to the server. I was able to workaround the issue by shutting down varnish and switching apache to listen on port 80, but this is temporary.

    I have a few sites with an SSL. I assigned each of those sites to use a unique IP address. How can I tell varnish to recognize and properly route those domains to the correct IP? I tried this in my default.vcl file, but I'm getting the cPanel 404 error page when I try to access domain-a.com. Here's what I tried:
    Code:
    backend default {
            .host = "1.2.3.4";
            .port = "80";
            .connect_timeout = 600s;
            .first_byte_timeout = 600s;
            .between_bytes_timeout = 600s;
    }
    backend unique {
            .host = "5.6.7.8";
            .port = "80";
            .connect_timeout = 600s;
            .first_byte_timeout = 600s;
            .between_bytes_timeout = 600s;
    }
    sub vcl_recv {
            if (req.http.host ~ "^(www\.)?domain-a\.com$" || req.http.host ~ "^secure\.domain-a\.com$") {
                    set req.backend = unique;
            } else {
                    set req.backend = default;
     	}
    
    
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    671
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    It's important to keep in mind that Varnish is not natively supported by cPanel. You may receive more input directly from the developers of Varnish or the developers of the installation script you used to install it.

    Thank you.
     
Loading...

Share This Page