Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8828743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:40:38+00:00 2026-06-14T07:40:38+00:00

I have a website www.mysite.com running behind a load balancer. There are two servers

  • 0

I have a website http://www.mysite.com running behind a load balancer. There are two servers in the load balancer cluster. Each runs Varnish 3.0 and Apache/PHP (I know varnish could load balance for me – but we have a preference for a different LB tech).

Every now and again I need to purge an URL or two…

In my VCL I have 127.0.0.1 as a trusted URL for PURGEs. And a standard purge config:

vcl_recv:

....

    if (req.request == "PURGE") {

        # Allow requests from trusted IPs to purge the cache

        if (!client.ip ~ trusted) {

           error 405 "Not allowed.";

        }

        return(lookup); # @see vcl_hit;

    }

...

sub vcl_hit {

if (req.request == "PURGE") {

    purge;

    error 200 "Purged (via vcl_hit)";

}



if (!(obj.ttl > 0s)) {

    return (pass);

}



return (deliver);

}

sub vcl_miss {

if (req.request == "PURGE"){

    purge;

    error 404 "Not in Cache";

}

return (fetch);

}

Now from a shellscript I want to invalidate an URL.

curl -X PURGE http://127.0.0.1/product-47267.html

Doesnt work, but

curl -X PURGE http://www.mysite.com/product-47267.html

Does work. Problem here is – I need to invalidate on each local machine in cluster – not have the request go out and back in via the load balancer (because I dont know which machine will take the PURGE).

Hope this makes sense

LW

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:40:39+00:00Added an answer on June 14, 2026 at 7:40 am

    You need to connect to localhost but Varnish still need to know which Host you want to PURGE.

    I’m not sure but try something like the following :

    curl -X PURGE -H "Host: www.mysite.com" http://127.0.0.1/product-47267.html
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have a website www.mySite.com and there are a lot of pages
I have a large website at www.mydomain.com. There are 1000 new documents per month
i have an asp.net website http://www.site.com . This web app is also running on
I have a url which could be www.website.com/order/?pg3=2 or www.website.com/orderstatus/?pg2= There could be several
I currently have three websites all running from the same DB example websites: www.mysite.com
Suppose I have a website hosted at the url: http://www.mysite.com/ Say this is hosted
For example I have a website that points to a page like this: http://www.mysite.com/folder/file
I've got a number of users, each with the website page like http://www.mysite.com/folder/artist_id.php?id=33 The
in my website I have some pages structured in this way: www.mysite.com/x/y.php?query=z I wrote
I have a website with urls like this : www.mysite.com/controller/action/id I need to create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.