Issue varnish purge through CloudFlare to Varnish

Posted by Michael on Server Fault See other posts from Server Fault or by Michael
Published on 2013-10-16T06:55:23Z Indexed on 2013/10/18 21:59 UTC
Read the original article Hit count: 536

Filed under:
|
|
|

I've been working on this for a while and can't seem to find any solution.

I have varnish sitting in front of my nginx server, with CloudFlare sitting in front.

When I issue a curl -X PURGE host CloudFlare picks it up and of course denies it with a 503 error. If I use direct.host to bypass CloudFlare it hits the Varnish server and it accepts the request but it does nothing since direct.host isn't used so there is nothing in the cache for that url.

I am using WordPress and there is a WordPress Varnish Purge plugin, it says to add the following line to wp-config.php:

define('VHP_VARNISH_IP','127.0.0.1')

This is specifically to work with proxy servers and/or CloudFlare to make sure the request goes to the Varnish server rather than CloudFlare, but that doesn't seem to help.

Anyone see this before and have any idea?

© Server Fault or respective owner

Related posts about nginx

Related posts about varnish