{% extends "varnish-bans-manager/core/bans/layout.html" %} {% load i18n %} {% load url from future %} {% load vbm_widget_helpers %} {% load vbm_form_helpers %} {% block title %}{% trans 'Bans' %} > {% trans 'Expert' %}{% endblock %} {% block sidebar_section %}expert{% endblock %} {% block sidebar_content %}
{% blocktrans with 'https://www.varnish-cache.org/docs/trunk/reference/varnish-cli.html#ban-expressions' as exprs %}
A ban expression may be composed of several
conditions combined using a logical AND operator (&&).
Each condition should consist of a field, an operator and an argument.
{% endblocktrans %}
req.url (requested URL), req.http.host
(requested host) or obj.http.set-cookie (returned value
for the HTTP Set-Cookie header).
{% endblocktrans %}
== for direct comparision, ~ for
a regular expression match, and > or <
for size comparisons. Prepending an operator with ! negates
the expression.
{% endblocktrans %}
KB, MB,
GB or TB appended for size related fields.
{% endblocktrans %}
req.url == /path/to/content
example.com:' %}
req.url ~ "\.pdf$" && req.http.host == example.com
obj.http.x-url ~ "\.pdf$" && obj.http.x-host == example.com