• Resolved Robert1112

    (@robert1112)


    Dear Epstein,

    Thanks so much for the awesome work. It cache and purge well with my wordpress stack. It has Nginx—>Varnish—>Haproxy—>Wordpress-PHP-FPM.

    After enabling Cloudflare proxy, purge won’t work manually or automatically.

    I tried to put in the varnish ip in the plugin with my server ip, 127.0.0.1 or 0.0.0.0. Still no luck. Is it because Varnish is in container?

    Any advice is very appreciated. Thanks so much.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Does the Varnish part of your stack have a different IP?

    Your Varnish IP must be one of the IPs that Varnish is listening on. 127 and 0 are internal IPs, not the ones Varnish listens on. Usually….

    Thread Starter Robert1112

    (@robert1112)

    Dear Epstein,

    Thanks for your reply. As previously explained, only Nginx is open to access from internet. Nginx and Varnish are in the same host. To be able to use Varnish IP, I open varnish at port 6081 and fill the server host IP for Vanish IP. Not working.

    I modify Varnish VCL to include below trying to include as much IP’s as possible. Can you spot any error or possible solution. I have searched and tried for weeks.

    vcl 4.0;

    import directors;

    backend default {
    .host = “balancer2”; # IP or Hostname of backend
    .port = “80”; # Port Apache or whatever is listening
    .connect_timeout = 600s;
    .first_byte_timeout = 600s;
    .between_bytes_timeout = 600s;
    .max_connections = 128;
    }

    acl cloudflare {
    “localhost”;
    “127.0.0.1”;
    “35.229.143.125”;
    “n6.wooshop.com.tw”;
    “172.16.128.4”;
    “172.17.0.6”;
    “172.16.0.0/16”;
    “172.17.42.1/16”;
    “172.17.0.0/16”;
    “172.16.1.0/24”;
    “::1”;
    }

    acl purge {
    “localhost”;
    “127.0.0.1”;
    “35.229.143.125”;
    “n6.wooshop.com.tw”;
    “172.16.128.4”;
    “172.17.0.6”;
    “172.16.0.0/16”;
    “172.17.42.1/16”;
    “172.17.0.0/16”;
    “172.16.1.0/24”;
    “::1”;
    }

    import std;

    include “lib/xforward.vcl”;
    include “lib/cloudflare.vcl”;
    include “lib/purge.vcl”;

    sub vcl_recv {
    # Remove has_js and Cloudflare/Google Analytics __* cookies.
    set req.http.Cookie = regsuball(req.http.Cookie, “(^|;\s*)(_[_a-z]+|has_js)=[^;]*”, “”);

    # Remove a “;” prefix, if present.
    set req.http.Cookie = regsub(req.http.Cookie, “^;\s*”, “”);

    # Remove the cloudflare cookie
    set req.http.Cookie = regsuball(req.http.Cookie, “__cfduid=[^;]+(; )?”, “”);

    ….

    Thread Starter Robert1112

    (@robert1112)

    Dear Epstein,

    Just to close it. It is solved. Thanks for your support and the awesome work.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘purge not working with Cloudflare proxy’ is closed to new replies.