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

  • Home
  • SEARCH
  • 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 8833839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:52:43+00:00 2026-06-14T08:52:43+00:00

I have a varnish 3.xx server which currently works. Varnish is caching the login

  • 0

I have a varnish 3.xx server which currently works.
Varnish is caching the login page of my site.

http://www.mysite.com/staff

but it may have different urls depending on the staff members link, for example

http://www.mysite.com/staff/index.php?/Tickets/Ticket/View/222200

My varnish config file is set as follows to exclude caching the staff page, but it is not working, as it is caching the login page and it is will not login untill i restart varnish to clear it’s cache.

sub vcl_recv {
    # Allow purge only from internal users
    if (req.request == "PURGE") {
        if (!client.ip ~ internal_net) {
            error 405 "Not allowed.";
        }
        return (lookup);

    # Exclude the following
    if (req.url ~ "^/login\.php" ||
      req.url ~ "^/search\.php" ||
      req.url ~ "^/admin(.*)" ||
      req.url ~ "^/admin(.*)" ||
      req.url ~ "^/search(.*)" ||
      req.url ~ "^/visitor(.*)" ||
      req.url ~ "^/staff(.*)" ||
      req.url ~ "^/staff\.php"
    )  {
        return(pass);

    }

    if (req.http.cookie ~ "vb(.*)" ||
        req.http.cookie ~ "bb(.*)" ||
        req.http.cookie ~ "SWIFT_(.*)" ||
        req.url ~ "\?(.*\&)?s=[a-fA-F0-9]{32}(\&|$)" ||
        req.http.cookie ~ "bb_password") {

        return(pass);
    } else {
        unset req.http.cookie;
    }
}

Do you perhaps have another method to exclude and entire directory from being cached?
IE: everything from /staff no matter what the suffix is after that must not be cached

  • 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-14T08:52:44+00:00Added an answer on June 14, 2026 at 8:52 am

    The exclusion should work perfectly the way you have implemented it. However if the code you pasted is your actual VCL you have an open if() statement in the PURGE section.

        sub vcl_recv {
            # Allow purge only from internal users
            if (req.request == "PURGE") {
                    if (!client.ip ~ internal_net) {
                            error 405 "Not allowed.";
                    }
                    return (lookup);
    
    # Exclude the following
    

    should read

        sub vcl_recv {
            # Allow purge only from internal users
            if (req.request == "PURGE") {
                    if (!client.ip ~ internal_net) {
                            error 405 "Not allowed.";
                    }
                    return (lookup);
            }
    
    # Exclude the following
    

    Varnish should not accept invalid VCL though, so if the error does not exist in your actual VCL, please update the question with your entire VCL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a server which needs to serve multiple domains though varnish e.g. example1.com,
I have installed varnish on my server which uses magento. the ports have changed
I have a website www.mysite.com running behind a load balancer. There are two servers
I have a Piwik install sitting behind a varnish-caching server. My problem is varnish
I have a problem with my server redirecting http://www.mylesgray.com:8080/ -> http://www.mylesgray.com/ . Here are
I have installed the Varnish cache with my Apache web server and configured them
I have this vcl varnish config file, but it is throwing an error when
We're currently running a site with: Pressflow 5.23.50 Varnish 2.1.4 I suspect some of
I have a website running behind a Varnish proxy. Any connection open for server-sent
Throughout our site we have a login button, whenever someone logs in the button

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.