Hi there fellow Drupalistas
I set up Varnish on my virtual server yesterday after following the excellent video guide created by Lullabot and some threads on this group
The Drupal sites I was playing around with were on sub-domains and late last night I noticed an odd redirection thing going on with the non-Drupal parent domain.
This morning I closed these sub-domains down, moved them elsewhere to their own domains and rebooted the server but Googlebot (checked in Webmaster Tools) isn't accessing the page - it just reads failed.
I'm looking at the sites headers and there doesn't appear to be anything untoward about them:
Server: Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
X-Powered-By: PHP/5.2.13
Cache-Control: max-age=2629743
Expires: Wed, 23 Feb 2011 21:48:09 GMT
Vary: User-Agent
Content-Type: text/html
Content-Length: 26455
Date: Mon, 24 Jan 2011 11:19:07 GMT
X-Varnish: 914744196
Age: 0
Via: 1.1 varnish
Connection: keep-aliveIs there a way of configuring the default.vcl file so that it only works on a domain specified? (What language is it written in?)

Comments
By-passing Varnish cache
If you want some domains or subdomains hosted on your machine not to be handled by Varnish, update your default.vcl file and adds something similar to this (this may have to be updated depending on the varnish version you are using):
# in the subrouting vcl_recv; when varnish gets the request...sub vcl_recv {
if (req.http.host == "subdomain.domain.example") {
# ... let the request hit the backend, without cache processing
return (pass);
}
}
If you want to know more about vcl (it's a must to understand Varnish correctly), read their manual: http://www.varnish-cache.org/docs/2.1/.
VCL syntax is easy and similar to C or Perl.
Thanks for the response I
Thanks for the response
I think I see what is happening now. Every visitor is recorded with the IP address of the server rather than their own.
I dealt with this on the Drupal site by adding
$conf['reverse_proxy'] = TRUE;$conf['reverse_proxy_addresses'] = array('109.203.105.34');
to the settings.php file
But how would I deal with this on a non-Drupal site?
Take a look at
Take a look at ip_address()
http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/ip_add...
Your non-Drupal site will need to do something similar.
--
Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his
mod-rpaf
Hi,
take a look at the mod-rpaf Apache-module (apt-get install libapache2-mod-rpaf and/or a2enmod rpaf).
Check your /etc/apache2/mods-available/rpaf.conf if you need to other reverse proxy address(es) than 127.0.0.1.
Atle
http://newreach.no
Thanks for that tip off. It
Thanks for that tip off. It was easy I just used this small piece of code:
if ($_SERVER['HTTP_X_FORWARDED_FOR'] != '') {$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
I don't know which system is
I don't know which system is used by your subdomains but you could also solve this in sub vcl_recv and forwarding the original client ip to the backend:
remove req.http.X-Forwarded-For;set req.http.X-Forwarded-For = client.ip;