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:
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;
}