How to install mod_rpaf Varnish WordPress Ubuntu

And the geekiest title of the week goes to me…

Add this line to your varnish VCL in sub_recv:

set req.http.X-Forwarded-For = client.ip;

Grab mod_rpaf:


Install mod_rpaf

dpkg -i libapache2-mod-rpaf_0.6-1_amd64.deb

Enable mod_rpaf:

a2enmod rpaf

Your rpaf config (/etc/apache2/mods-enabled/rpaf.conf) should look awesome like this:

<IfModule mod_rpaf.c>
RPAFenable On
RPAFsethostname On

Note: RPAFproxy_ips is the ips of your varnish cache servers. Varnish is awesome.

Reload varnish and Apache the cool way.

/etc/init.d/varnish reload
/etc/init.d/apache reload

Test it by looking at your remote_addr variable:


Leave a Reply

Your email address will not be published. Required fields are marked *