Thinking about offering varnish caching for my clients

Discussion in 'Developers' Forum' started by Rein van 't Veer, Nov 3, 2016.

  1. Hey,
    I've been thinking about implementing a varnish cache in front of my customer's websites on request (lots of things to do :p).
    • Create plugin for ispconfig that gives clients the option to enable/disable varnish for each website
    There are a couple of ways to accomplish that with the easiest being varnish running on port 80 as a reverse proxy for apache on port 8080 (example). When used in combination with ssl use nginx to offload ssl and forward requests to varnish.

    The plugin would modify the varnish-configuration to keep a cache for the specified domain or not.
    if yes --> use caching
    if no --> just fetch from apache every time.

    Now here is my question:
    Does anyone know if it is possible to ignore the use of .htaccess redirect options in apache?
    I think i'll need this because I would be creating a loop if a user defined a rewrite to https like the following example:

    Client requests http --> varnish(80) --> apache(8080) --> .htaccess --> mod_redirect says: if no ssl --> use https -->
    client requests https --> nginx(443) --> varnish(80) --> apache(8080) --> .htaccess sees connection as http --> mod_redirect: if no ssl --> use https.

    You see? this would create a loop.
    Anyone any bright ideas to figure this out?
     
    Tom Dings likes this.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess in apache you should be able to disallow rewrite rules in .htaccess files by using AllowOverride none.
     
  3. that would disable all rewrite rules, correct? also the ones that just rewrite for clean url's
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes
     

Share This Page