Project

General

Profile

Actions

Feature #4489

closed

Add Varnish 4 Plugin

Added by Joshua Ruehlig about 9 years ago. Updated about 8 years ago.

Status:
Needs Patch
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
03/05/2015
Due date:
% Done:

0%

Estimated time:
Plus Target Version:

Description

I request we add an plugin for www/varnish4 (added to the ports tree 3/3/2015).

VCL changes from varnish3 to varnish4 are noted here.
https://www.varnish-cache.org/docs/trunk/whats-new/upgrading.html#changes-to-vcl

Some suggestions I have..
  1. let backends handle compression (default)
  2. always compress content (https://www.varnish-cache.org/docs/trunk/users-guide/compression.html#compressing-content-if-backends-don-t)
  3. always uncompress content (https://www.varnish-cache.org/docs/trunk/users-guide/compression.html#uncompressing-content-before-entering-the-cache)
  • varnish4 sets X-Forward-For before vcl_recv.
  • The option "SSL Offload server ACL" should overwrite the X-Forwarded-For header instead of X-Forwarded-Varnish, and it no longer needs to set anything using the client.ip. I don't know who actually uses X-Forwarded-Varnish, but x-Forwarded-For is the current norm, and makes things simpler because that's what varnish4 has built in.
  • We should also have an option to unset the X-Forwarded-Proto header if not coming from the trusted "SSL Offload server ACL"
  • We might want to add the X-Forwarded-Proto header to the vcl_hash for non-text objects. This way we don't serve an HTML/JS/CSS page with mixed content for a site that allows both HTTP and HTTPS access.
    if (req.http.X-Forwarded-Proto && !req.url ~ "\.(zip|pdf|rtf|flv|swf|gif|jpg|jpeg|bmp|png|ico|img|tga|wmf|mp3|ogg)$") {
    hash_data(req.http.X-Forwarded-Proto);
    }
    
  • We should add a "Purge ACL" option. Enabling purging in varnish4 is described here. https://www.varnish-cache.org/docs/trunk/users-guide/purging.html#http-purging

Tell me if you need any help making this feature request a reality. Thanks!

Actions #1

Updated by Joshua Ruehlig about 9 years ago

I made a mistake in my wording..
"We might want to add the X-Forwarded-Proto header to the vcl_hash for non-text text objects."

Actions #2

Updated by Chris Buechler almost 9 years ago

  • Project changed from pfSense to pfSense Packages
  • Status changed from New to Needs Patch
Actions #3

Updated by Joshua Ruehlig about 8 years ago

Varnish 4.1 now supports the PROXY protocol from an upstream server.
This replaces the need for accepting X-Forward-For HTTP headers from frontends that support the protocol downstream (HAProxy, NGINX, stunnel, stud, etc..).

https://www.varnish-cache.org/docs/trunk/whats-new/changes.html#proxy-protocol-support
Varnish would need to be able to be started with one or two IP:port parameters, some of which with ",PROXY" after them.

I don't think Varnish has implemented PROXY protocol downstream, to for example a webserver like NGINX/Apache, yet.

Actions

Also available in: Atom PDF