Loading RustProxy…

Connecting to the administration panel.

The panel is taking longer than expected. Check your connection and try again.

Reload panel
CONTROL ROOM / Overview
CACHE SETTINGS · VCL SUBSET

Practical cache & VCL guide

Practical notes for RustProxy, not a promise of complete Varnish VCL compatibility. Only imported and accepted rules are executed.

Values reflect the current form, which may contain unsaved changes.

no-cache, TTL and grace

With Varnish compatibility and a positive fallback TTL, an eligible Cache-Control: no-cache response can be served as HIT for that TTL without public. With compatibility off, no-cache requires validation before reuse. Grace is a separate stale-response window, not a fallback TTL.

Cache-Control: no-cache
Fallback TTL: 60 s
Varnish-compatible: ON

Do not expect a HIT for private/no-store/Set-Cookie or when the request is BYPASS. This override is not the default Varnish VCL behavior.

Cookie and return(hash)

Cookies normally trigger BYPASS. In compatible mode, an explicit return(hash) can admit eligible Cookie requests; the full Cookie remains on the backend request and partitions the cache. Catch session cookies with return(pass) first.

sub vcl_recv {
  if (req.http.Cookie ~ "session=") {
    return (pass);
  }
  if (req.url ~ "^/public/") {
    return (hash);
  }
}

unset req.http.Cookie removes ALL cookies, including from the request sent to the backend. Authorization and authentication protections still apply.

Vary and cache variants

set/unset beresp.http.Vary changes variant selection before storing. set/unset resp.http.Vary only changes what the client sees; it does not repair the stored cache key. An assignment replaces the whole Vary list.

sub vcl_backend_response {
  set beresp.http.Vary =
    "Accept-Encoding, Accept-Language";
}
sub vcl_deliver {
  unset resp.http.X-Powered-By;
}

Never remove a required Vary dimension for a personalized or encoded response. RustProxy may restore Vary: Cookie for cookie-partitioned objects; static Ignore Vary: Cookie requires public and other safety checks.

set/unset headers

beresp.http.* edits the backend response before the cache decision; resp.http.* edits only the delivered response. Removing beresp.http.Cache-Control can change cache eligibility, while removing resp.http.Cache-Control cannot.

sub vcl_backend_response {
  unset beresp.http.X-Debug;
  set beresp.http.Cache-Control =
    "public, max-age=60";
}
sub vcl_deliver {
  unset resp.http.X-Powered-By;
}

Only literal string assignments are imported; protected transport/body headers cannot be edited. Removing Set-Cookie requires a dedicated backend action and is unsafe for session responses.

Request headers and storage overrides

Safe set/unset req.http headers are applied before subsequent rules, hashing and forwarding to the origin. beresp.uncacheable = false reverses an earlier rule's no-store decision, but does not override origin private/no-store/Set-Cookie.

sub vcl_recv {
  unset req.http.X-Tracking;
  set req.http.X-Device = "mobile";
}
sub vcl_backend_response {
  set beresp.uncacheable = false;
}

Authorization, Cookie (except dedicated unset), Cache-Control and forwarding/transport headers are protected in request rules. Complex URL rewrites are warned about, not guessed. Always review import warnings.

RustProxy's beresp.uncacheable = false applies only to a previous cache-rule restriction; this is not Varnish's exact behavior. The backend's private/no-store and Set-Cookie protections remain unless deliberately rewritten by a separate trusted rule.

Cloudflare and Akamai technical Cookie template

Only strip the Cookie header when every cookie is a known technical CDN cookie. Any session or unknown cookie, Authorization, private path or non-GET/HEAD method bypasses cache.

// Optional template: only shared/public content independent of these cookies.
// Cloudflare: __cf_bm, cf_clearance, _cfuvid, __cfruid, __cfseq
// Akamai: _abck, ak_bmsc, bm_sz, bm_sv
// Security cookies can be needed for bot challenges; review before enabling.
sub vcl_recv {
    if (req.method != "GET" && req.method != "HEAD") {
        return(pass);
    }
    if (req.url ~ "^/(admin|api|auth|login|logout|panel|konto|dashboard)(/|[?]|$)") {
        return(pass);
    }
    if (req.http.Authorization) {
        return(pass);
    }
    // Match the complete Cookie header, not one cookie within it.
    if (req.http.Cookie ~ "^(?:__cf_bm|cf_clearance|_cfuvid|__cfruid|__cfseq|_abck|ak_bmsc|bm_sz|bm_sv)=[^;]*(?:;[ \t]*(?:__cf_bm|cf_clearance|_cfuvid|__cfruid|__cfseq|_abck|ak_bmsc|bm_sz|bm_sv)=[^;]*)*$") {
        unset req.http.Cookie;
    }
    if (req.http.Cookie) {
        return(pass);
    }
    return(hash);
}

Optional policy: some CDN challenge cookies are required at the origin. Verify public pages and the challenge flow before using this template. It does not override Cache-Control and Vary admission safeguards.

VCL stages and rule precedence

vcl_recv handles pass/hash and request rewrites; vcl_hash supports selected hash_data(req.http.X); vcl_backend_response handles TTL, grace and backend headers; vcl_deliver edits final headers, even on HIT or BYPASS.

Rules for the vhost are evaluated before matching global rules. Per-vhost changes win on conflicting supported settings and headers, or global rules may be disabled for the vhost. Importing VCL converts it into graphical rules; review warnings and the resulting order before saving.

Not yet a full Varnish interpreter: vcl_hit/vcl_miss/vcl_pass hooks, arbitrary sub/call, VMOD, ACL expressions, beresp.keep, hit-for-miss/pass, restart, retry, synth and purge are not executed as VCL.

hash_data(req.url) and hash_data(req.http.Host) are already included in the internal cache key. vcl_hash can add one extra req.http.* header, but it does not automatically generate a matching Vary header.

RustProxy currently stores only HTTP 200 responses. A TTL rule for 404/301 does not enable caching of those statuses; the former 404 template was removed to avoid suggesting otherwise.

VCL export is a readable preview, not a lossless round-trip. If import reports warnings, rules are not added until you explicitly accept the partial result. Editing the source or closing the importer discards any pending import.

Why isn't it a HIT?

Enable X-Cache and detailed reason headers; disable Only on HIT while debugging. Send two identical GET requests with curl (not a browser hard reload), then compare the cache outcome and origin headers.

curl -sS -D - -o /dev/null \
  https://example.com/public/page
curl -sS -D - -o /dev/null \
  https://example.com/public/page

BYPASS usually means request exclusion (Cookie, Authorization, route or query). MISS means the backend was contacted, but does not prove that the response was stored. Check X-Cache-Reason, Cache-Control, Set-Cookie, Vary and Age.

CACHE

Cache purge / ban

The selected vhost limits the operation. Exact and prefix values include the query string. Regex and root-prefix / operations require an additional confirmation.

CACHE

Active BAN rules

ID Selector Value Host Vhost Expires Actions

No active BAN rules.

Persistent cold cache

Clean cold cache

Runs asynchronously and uses the same eviction mechanism as automatic cold-cache GC.

Dashboard presets

Save named arrangements and restore them from any browser. Use Unlock layout on Overview to move, resize or hide cards before saving a preset.

Built-in presets

Ready-made layouts for common tasks. Loading one replaces the current arrangement; save it under your own name to keep changes.

My presets

To rename a preset, type its new name above and choose Rename next to the saved preset.

WEBSOCKET / CONNECT

Active WebSocket / tunnels

ID Client Host Upstream Protocol Duration RX TX Actions

No active tunnels.

SQLITE / LAST 512 REVISIONS

Revision history

Select a marked day to inspect the saved configuration revisions and their changes.

Full JSON comparison

Before


            

After


            
SQLITE / LAST 100 / RETAINED 10,000

Administration audit

Recent administration changes are loaded only when this window is opened.

Time Actor Action Detail

No audit entries.

Live access logs

ACTIVITY

Access log

Columns
Time Request Host Source IP Vhost Backend Status Duration Cache Outcome Transport WebSocket Upstream error

No traffic yet. Open the proxy to make your first request.

Live view starts with the latest 256 completed exchanges. Increase buffer to keep accumulating live entries up to 4096 until the log window is closed.

Web Service configuration

NEW
Configuration preset
Preset action

Presets fill normal Web Service settings and remain fully editable. Document root, service ID/name and PHP-FPM endpoint are not replaced.

General settings

Shared FastCGI profiles

Expand a profile to edit it. Changes are saved immediately and shared by every attached Web Service.


.htaccess compatibility

This is a migration-oriented compatibility layer, not a complete Apache runtime. Supported directives are compiled into RustProxy Web Server rules.

Supported subset

RewriteEngine, RewriteBase, RewriteCond, RewriteRule, DirectoryIndex, AcceptPathInfo On/Off/Default, Options +/-Indexes, AddType, AddHandler (PHP extensions), Header set/add/unset, ExpiresActive, ExpiresDefault, ExpiresByType, Redirect/RedirectMatch, ErrorDocument (local URL), Require all granted/denied.

Rewrite compatibility

Rewrite conditions support REQUEST_FILENAME file tests (-f, -d, -s), REQUEST_URI, REQUEST_METHOD, QUERY_STRING, HTTP_HOST, HTTPS, DOCUMENT_ROOT, THE_REQUEST and HTTP headers. Flags: L, END, R, R=301/302/307/308, QSA, NC, F, OR. PT/NE are accepted as no-ops. E= is accepted as a compatibility no-op because request HTTP headers already reach PHP-FPM.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

PHP-FPM

.htaccess may add PHP extensions with AddHandler. AcceptPathInfo On enables PHP script/path suffix routing and Off disables it, overriding the Web Service PATH_INFO switch. The PHP-FPM endpoint, timeouts and concurrency remain controlled by the Web Service PHP-FPM tab. The unchanged default index list also tries index.php last when PHP-FPM for .php is enabled. Apache SetHandler proxy socket syntax is intentionally not accepted.

Loading and limits

Files are read and compiled on Validate, save and apply. RustProxy does not parse .htaccess per request. Re-apply after changing a file. The scan is bounded to 128 files, depth 16, 128 KiB per file and 1 MiB total.

Not Apache-complete

Only local ErrorDocument URLs are supported (GET/HEAD); custom literal/external error documents, SetEnvIf, FallbackResource, Options FollowSymlinks and Options MultiViews are not implemented. Order/Allow/Deny with all, IP or CIDR (IPv4/IPv6) and Files/FilesMatch access rules are enforced. Unsupported authentication/authorization, host-based access and handler rules still fail closed, even with Strict off. Other unsupported non-security directives are logged and skipped with Strict off. Re-apply the Web Service after .htaccess changes.

Vhost/location ACL, authentication, error pages and response rules still remain authoritative. .htaccess cannot escape the document root, select an arbitrary FastCGI socket or override protected framing headers.

PHP-FPM / FastCGI configuration

The same fields and syntax apply to a local Web Service PHP configuration and a reusable PHP-FPM profile. A selected profile overrides local PHP fields for all attached services. RustProxy connects to an already running PHP-FPM pool.

Enabling PHP and PATH_INFO

Enables execution of configured PHP extensions via the PHP-FPM socket. The pool must already be running; RustProxy does not start PHP. Other files remain static.

Allows /static.php/skins/file.css to run the existing static.php script with PATH_INFO=/skins/file.css. Needed by Roundcube static.php routes; usually not required for WordPress. Off by default.

Passes the incoming Authorization header to PHP as HTTP_AUTHORIZATION. Enable for API/Bearer/Basic authentication; disable if the application does not need it.

Endpoint syntax

unix:/run/php/php_wordpress.sock
tcp:127.0.0.1:9000
tcp:[::1]:9000

Use unix: for the full local socket path or tcp: plus a literal loopback IP and port. Hostnames and non-loopback TCP are rejected. The RustProxy user must be allowed to connect to the socket. Separate pools when PHP INI security settings differ.

Execution and size limits

PHP extensions: comma-separated names such as php, phtml (no leading dots). Connect timeout: 1000 ms = 1 second. Full FastCGI request timeout: 30000 ms = 30 seconds. Concurrent requests: 64 (returns 503 when exhausted). Request body: 67108864 bytes = 64 MiB; 0 means unlimited by RustProxy. Response headers: 65536 bytes. STDERR: 4096 bytes; 0 disables capture. All numeric fields require integers; PHP INI limits are separate.

Custom FastCGI parameters

APP_ENV = production
APP_DEBUG = 0
TENANT = main

Put these in Custom FastCGI parameters only. One NAME = value per line; names start with A-Z and then contain A-Z, 0-9 or underscore (max 64 characters). Values are static, up to 8192 bytes each; no placeholders are expanded. Do not use SCRIPT_FILENAME, HTTP_* or PHP_VALUE/PHP_ADMIN_VALUE here.

PHP_VALUE — regular php.ini overrides

memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 30
error_reporting = E_ALL
log_errors = On
display_errors = Off
date.timezone = Europe/Warsaw

Enter these in PHP INI overrides (PHP_VALUE), not in FastCGI parameters. Use one directive = value per line (php.ini notation, no [section] headers or PHP tags). Exact support depends on which directives PHP-FPM permits to change. Common sizes use M/G, booleans On/Off and times seconds. Do not duplicate a directive in PHP_ADMIN_VALUE.

PHP_ADMIN_VALUE — administrator-only overrides

open_basedir = /var/www/webmail/:/tmp/:/usr/lib/php/
display_errors = Off
log_errors = On

Put these in PHP administrator INI overrides (PHP_ADMIN_VALUE). open_basedir lists allowed directories separated by ':' on Unix. Set it to paths of THAT application; do not reuse Roundcube restrictions in a WordPress pool. For security-sensitive values, prefer php_admin_value[...] in the configuration of a dedicated PHP-FPM pool. Shared FPM workers can retain request-supplied INI settings.

Storage, validation and troubleshooting

Each INI name may contain letters, digits, '.', '_' and '-' (up to 64 bytes); a value must be nonempty (up to 8192 bytes). Max 64 custom FastCGI entries and 64 INI overrides per map, with a total 128 KiB budget. No control characters or multi-line values. Values are saved in normal configuration: never place secrets there unless that storage is acceptable. A syntax-valid directive can still be rejected/ignored by PHP itself.

Critical: per-service PHP_VALUE/PHP_ADMIN_VALUE do NOT isolate applications when they share one PHP-FPM worker pool. Use different Unix sockets and restart the pools after moving WordPress and Roundcube apart. PATH_INFO does not fix open_basedir isolation.

Vhost configuration

NEW

Private IP binding is not authentication. Keep firewall/ACL rules. HSTS preload is opt-in; affinity cookies are not login sessions.

Redirect configuration

NEW
Host and domains
FRONTEND

Listeners

Protocols

Longest matching path wins. 307/308 preserve the request method; 301/302/303 may change it in clients.

Redirect hosts do not contact a backend. Global host ACLs still apply. Avoid self-referential rules that can create browser redirect loops.

404 host configuration

NEW
Host and domains
FRONTEND

Listeners

Protocols

Local response

The host never opens an upstream connection. The built-in placeholder is no-store and intentionally omits optional RustProxy diagnostic/server headers.

Stream configuration

NEW

Changing a stream listener requires a RustProxy restart.

SELF-CHECK

Application status

Checking application status

About RustProxy

RustProxy__RUSTPROXY_VERSION__

Reverse proxy, web server, certificate manager and traffic monitor in a single service with a built-in administration panel.

Author
Mateusz Gruszczyński · linuxiarz.pl
License
GNU AGPL v3.0 or later
Copyright
© 2026 Mateusz Gruszczyński
SPDX identifier
AGPL-3.0-or-later

License summary

RustProxy is free and open-source software. You may use, study, modify and redistribute it under the terms of the GNU Affero General Public License, version 3 or any later version.

  • Use it for any purpose, including commercial deployments.
  • Distributed copies and modified versions must stay under the same license and include their source code.
  • If you run a modified version as a network service, its users must be able to obtain the modified source code.
  • The software is provided without any warranty.

Visual field builder

CONFIGURABLE JSON

Select source fields and optionally rename their JSON keys. Changes are written to the advanced JSON mapping when applied.

Fields

Enabled Source field Output JSON key

Preview