0

I'm running CentOs 7 with DirectAdmin. I have created some users with websites. This works fine on httpd. But after installing Varnish, I get the notification "Apache is functioning normally". How can I configure varnish to send domainone.com to

/var/html/www/domainone.com/public_html and domaintwo.com to /var/html/www/domaintwo.com/public_html

I've already tried to add backend server to the right direction and port but the page stays redirected to the apache notification.

Any help is much appreciated. Thanks in advance.

handlerFive
  • 870
  • 10
  • 23

1 Answers1

0

How is you apache configured?

The generic answer to you question would be something like:

sub vcl_recv {
    if (req.http.host == "www.domainonecom") {
        set req.url = "/var/html/www/domainone.com/public_html" + req.url;
    } else if (req.http.host == "www.domaintwo.com") {
        set req.url = "/var/html/www/domaintwo.com/public_html" + req.url;
    } else {
        return (synth(404));
    }
}

but it doesn't seem right because varnish passes the host header along (by default), so if your apache works, varnish should change that. Have a look at varnishlog -d -q 'BereqURL' -g request and see what gets sent to the backend.