v0.39.1
This commit is contained in:
1 parent
53d92e0da6
commit
08d1608ef5
21 files changed
+928
-408
No files matched your search
+4
-3
@@ -4,7 +4,7 @@ This guide describes the VCL **subset implemented by RustProxy 0.39.1**, not the
|
||||
|
||||
For a short operational reference inside the panel, open **Cache & VCL guide** from **Settings → Cache**, the ordinary **Vhost → Cache** editor or **Docker vhosts → Cache**. The same modal works in all three places; example VCL is pasted into the importer of the editor that opened the guide, and the modal labels that scope. The modal shows the current compatibility-mode, fallback-TTL and grace settings, explains `Vary` and header mutations with examples, and identifies unsupported Varnish hooks. It complements this exact syntax reference; it does not execute VCL or save settings.
|
||||
|
||||
For an expanded **implemented / restricted / graphical-only / intentionally excluded / not implemented** inventory, consult the [complete VCL support matrix](VCL_SUPPORT_MATRIX.md). For practical production scenarios, **12 copyable VCL examples**, HTTP traffic outcomes, a `curl` validation plan and troubleshooting, use the [VCL traffic cookbook](VCL_TRAFFIC_COOKBOOK.md) (also available from the embedded Reader). It names each supported hook, variable and return action and the deliberate HTTP/security boundaries.
|
||||
For the **complete reference to all 42 quick-rule templates** (conditions, stages, defaults, cookie/session safety, TTL and testing), see the [Cache rule template library](CACHE_TEMPLATE_LIBRARY.md). These graphical presets are distinct from directly importable VCL. For an expanded **implemented / restricted / graphical-only / intentionally excluded / not implemented** inventory, consult the [complete VCL support matrix](VCL_SUPPORT_MATRIX.md). For practical production scenarios, **12 copyable VCL examples**, HTTP traffic outcomes, a `curl` validation plan and troubleshooting, use the [VCL traffic cookbook](VCL_TRAFFIC_COOKBOOK.md) (also available from the embedded Reader). It names each supported hook, variable and return action and the deliberate HTTP/security boundaries.
|
||||
|
||||
## Where to import, rule order and activation
|
||||
|
||||
@@ -21,6 +21,7 @@ For an expanded **implemented / restricted / graphical-only / intentionally excl
|
||||
| `vcl_recv` | `return(pass);` | Stops request processing for the matching path; bypasses shared cache. |
|
||||
| `vcl_recv` | `return(hash);` or `return(lookup);` | Stops `vcl_recv` and requests a cache lookup. In compatibility mode, may admit a GET/HEAD carrying `Cookie` (with cookie-partitioned variants); other protections remain. |
|
||||
| `vcl_recv` | `unset req.http.Cookie;` | Removes the **whole** request Cookie header, including what is forwarded to the origin. |
|
||||
| `vcl_recv` | `remove_req_cookies("parent_analytics");` | **RustProxy extension:** removes only the specified exact-name cookie(s) from the request before later rules, cache lookup and origin forwarding. Remaining session cookies are not removed and can still trigger BYPASS. Not standard Varnish VCL. |
|
||||
| `vcl_recv` | `set req.http.X-Device = "mobile";` / `unset req.http.X-Tracking;` | Sets/removes a **safe request header** before later conditions, `vcl_hash`, cache policy and the forwarded origin request. Assignments are constant strings, and a per-vhost edit takes priority over a conflicting global edit. Authentication, identity, request cache policy and transport headers are protected (see below). |
|
||||
| `vcl_recv` | `set req.url = regsuball(req.url, "([?&])(utm_[^=&]*|gclid)=[^&]*", "\1");` | **Restricted conversion only:** recognizes the specific captured-separator, query-parameter-removal pattern. Other `regsub` / `regsuball` rewrites are skipped with warnings; arbitrary URL regex replacement is not supported. |
|
||||
| `vcl_hash` | `hash_data(req.http.X-Name);` | Adds one request header's value to RustProxy's **internal** variant key. It does not automatically add `Vary` for downstream caches. |
|
||||
@@ -55,7 +56,7 @@ sub vcl_hash {
|
||||
|
||||
Both header edits are visible to later matching rules, the hash calculation and the origin. They also run on cache-disabled reverse-proxy routes (without enabling cache). They **do not** rewrite the client's original `Vary` requirements: if the response varies by `X-Device`, include it in `beresp.http.Vary` or configure it at the origin. A later `unset` is different from setting an empty string.
|
||||
|
||||
Protected request headers cannot be set or removed by general request rules: `Authorization`, `Cookie` (except the existing dedicated whole-header `unset`), `Cache-Control`, `Pragma`, `Host`, range/precondition headers (`If-*`, `Range`), forwarding and origin identity headers (`Forwarded`, `Via`, `X-Forwarded-*`, `X-Real-IP`, `X-Client-IP`, `CF-Connecting-IP`, `True-Client-IP`), `Proxy-*`, `Sec-*`, `X-RustProxy-*`, `Content-Type`, `Expect` and the protected transport/body header list below. Rejected edits are warned about and never silently applied. Do not assume imported VCL can change authentication or request-cache restrictions.
|
||||
Protected request headers cannot be set or removed by general request rules: `Authorization`, `Cookie` (except dedicated whole-header `unset` or exact-name `remove_req_cookies(...)` actions), `Cache-Control`, `Pragma`, `Host`, range/precondition headers (`If-*`, `Range`), forwarding and origin identity headers (`Forwarded`, `Via`, `X-Forwarded-*`, `X-Real-IP`, `X-Client-IP`, `CF-Connecting-IP`, `True-Client-IP`), `Proxy-*`, `Sec-*`, `X-RustProxy-*`, `Content-Type`, `Expect` and the protected transport/body header list below. Rejected edits are warned about and never silently applied. Do not assume imported VCL can change authentication or request-cache restrictions.
|
||||
|
||||
The query-removal conversion accepts only the supported captured-separator `regsuball` pattern. **Every such conversion emits a warning**, because removing parameters with RustProxy's parser can normalize separators differently from a regex replacement. Variable-name classes such as `utm_[a-z]+` are approximated by a prefix wildcard; value patterns ending in `[^&]+` may preserve empty values that `strip_query` removes. **Review generated parameters and warnings** if byte-exact URL behavior matters. Other URL rewrites are deliberately **not** guessed from keywords such as `utm_`.
|
||||
|
||||
@@ -147,7 +148,7 @@ sub vcl_recv {
|
||||
}
|
||||
```
|
||||
|
||||
Use `unset req.http.Cookie;` only when the origin does not need **any** cookies for that route. For a public Vhost that receives cookies from its parent domain, see the [opt-in inherited-cookie recipe](VCL_TRAFFIC_COOKBOOK.md#12-public-vhost-inherited-cookies-opt-in). `Cookie` does not disclose the setting `Domain`, so this is an intentional all-cookie removal, not automatic recognition of inherited cookies. A graphical **Strip cookies** action can keep an allowlist (not imported from arbitrary VCL cookie rewriting). In strict RFC mode (`cache.varnish_compatible=false`), `return(hash)` does not bypass the request Cookie restriction. `Authorization`, non-GET/HEAD traffic, request `no-store`, access/authentication and sticky-session checks still apply.
|
||||
Use `unset req.http.Cookie;` only when the origin does not need **any** cookies for that route. For a Vhost that receives cookies from a parent domain, prefer the [name-selective opt-in recipe](VCL_TRAFFIC_COOKBOOK.md#12-parent-domain-cookies-remove-selected-names-opt-in): `remove_req_cookies("exact_cookie_name");` is a **RustProxy-specific extension** that removes only named cookies, preserving session and other cookies for later rules. The separate CDN technical-cookie policy still has its own anchored allowlist and remaining-cookie pass. `Cookie` does not disclose the setting `Domain`, so a name must be verified outside RustProxy; avoid removing a name also used by this Vhost. A graphical **Strip cookies** action keeps an allowlist but is not equivalent to selective removal. In strict RFC mode (`cache.varnish_compatible=false`), `return(hash)` does not bypass the request Cookie restriction. `Authorization`, non-GET/HEAD traffic, request `no-store`, access/authentication and sticky-session checks still apply.
|
||||
|
||||
## `no-cache` and TTL
|
||||
|
||||
|
||||
Reference in new issue
Block a user