Skip to main content

Origin / Upstream — origin servers & load balancing

Origin / Upstream declares the origin server(s) VNIS fetches content from on a cache MISS. You can declare multiple origins and choose how to load balance between them, enable health checks to automatically remove dead origins, use a circuit breaker to temporarily cut off failing origins, configure TLS to the origin (including mTLS), or point to a private S3 bucket.

Use this when: you want to spread load across several backends, increase fault tolerance, or use S3 as the origin. Example: your shop has 3 backend servers — declare all 3, choose round_robin, and enable an http health check so VNIS automatically stops sending traffic to any server that is failing.

Before you start​

  • The domain has been added and points to VNIS.
  • You have the origin address(es) in the form http(s)://. The origin must not be an internal/loopback IP (SSRF protection).

How to configure​

  1. Go to Domains → select the domain → Upstream tab. Go to Domains → select the domain → Upstream tab
  2. Choose the origin type: HTTP (default) or S3.
  3. For HTTP: enter at least one Origin Server (URL). If you have several origins, set the Weight and choose a Load Balancer (selector).
  4. (Optional) Open Health Check, choose tcp/http, and set the Interval; open Circuit Breaker, TLS to Origin, Origin Shield, and Retry policy if needed.
  5. Click Save and wait a few seconds for the sync.

Configuration fields​

Origin & load balancing:

FieldMeaningValuesDefaultNotes
Origin Servers (URL list)List of origin servers≤64 URLs, each URL ≤2048 characters, http(s)://—At least 1 required; private/loopback addresses are blocked
WeightLoad distribution weight (WRR)1–1000 (number of entries = number of URLs)—Sent only when the selector is weighted_round_robin or failover; with failover, priority follows the position in the list, not the weight
Load Balancer (selector)Origin selection algorithmround_robin, weighted_round_robin, random, least_connections, ip_hash, consistent_hash, failoverround_robinrandom/ip_hash/consistent_hash/least_connections ignore the weight
ProtocolProtocol to the originh1.1, h2, h2h1h1.1h2/h2h1 are negotiated only over TLS; on http:// they fall back to H1 automatically
Max RetriesNumber of retries per request0–102—
Connection Pool Size(intended) keepalive pool sizeRead only256Display only — this value cannot be changed per domain

Health check & Circuit breaker:

FieldMeaningValuesDefaultNotes
Health Check TypeType of active health checknone, tcp, httpnoneOnly tcp/http probe and drive the circuit breaker
Health Check IntervalProbe interval1–3600 seconds5Lower = faster failure detection, higher probe load
Health Check PathProbe path (when type=http)Path/healthUsed only when type=http
Circuit BreakerEnables circuit breaking for failing originsOn/offOffWorks only when Health Check Type ∈ {tcp,http}
Failure ThresholdNumber of consecutive failed probes to open the circuit1–10005—
Recovery (secs)Wait time before trying half-open1–3600 seconds30—
Half-Open ProbesNumber of probes allowed in the HalfOpen stateNumber3—

TLS to origin & headers:

FieldMeaningValuesDefaultNotes
TLS to OriginEnables TLS from edge to originOn/offOffTurning it on with an http:// URL returns error 400
Skip cert verificationSkips origin certificate verificationOn/offOff (verification enabled)On = MITM risk; shown only when TLS to Origin is on
SNI OverrideSets the SNI manuallyHostname (no :, no IP literal, ≤253 characters)(empty)Requires TLS to Origin to be on
MTLS certificateSelects the client cert/key pair for mTLSCertificate in the store(none)Shown only when TLS to Origin is on; the referenced certificate is checked for existence — it must already be in the store with its private key, otherwise you get 400
Host HeaderOverrides the Host sent to the originString(empty = the request's Host)—
Custom Origin HeadersFixed headers sent to the origin≤50 headers; name is printable ASCII, no :; value has no CR/LF, ≤8192 bytes——

Origin Shield & Retry:

FieldMeaningValuesDefaultNotes
Shield AddressIntermediate node that reduces origin loadResolvable host:port(empty)MISS requests go through the shield; skipped if it points to the node itself
Use TLS (shield)TLS for the hop to the shieldOn/offOff—
Shield SNI OverrideSNI to the shieldHostname(empty)Requires Use TLS (shield) to be on
Retry on Status CodesHTTP codes that trigger a retryList of codes—Empty = no status-based retries
Retry on Connect FailureRetry on TCP connect failureOn/offOn—
Retry on TimeoutRetry when the origin times outOn/offOn—
Retry on Connection ResetRetry when the origin resets mid-responseOn/offOff—
Prefer IPv4 upstreamPrefer IPv4 when resolving the originOn/offOffWorks around cross-carrier IPv6 peering issues

S3 origin (shown when the S3 type is selected):

FieldMeaningValuesDefaultNotes
Access Key IDAccess key≤128 characters—Required; partially masked when viewed again
Secret Access KeySecret signing key≤256 characters—Required; shown as ******** when viewed again, kept unchanged on save
RegionSigV4 signing region≤64 characters, [a-z0-9-]us-east-1—
Bucket NameBucket name≤255, [a-zA-Z0-9-.](empty)Empty = dynamic bucket taken from the path
Addressing StyleAddressing stylevirtual_hosted / pathvirtual_hostedMinIO/GCS usually use path
Custom EndpointCustom endpoint (MinIO/R2…)≤512 characters(empty = AWS)Private/loopback addresses are blocked
Block write methodsBlocks writes at the edgeOn/offOnOn = PUT/DELETE/PATCH return 405

Configuration examples​

Example 1 — 3 backends with round robin load balancing + HTTP health check.

  • Origin Servers: https://be1.example.com, https://be2.example.com, https://be3.example.com · Selector: round_robin · Health Check Type: http · Path: /healthz · Interval: 5.
  • Expected result: traffic is spread evenly across the 3 backends; any backend whose /healthz probe keeps failing is temporarily removed.
  • How to check: stop be2 → repeated curl requests still return 200 (traffic shifts to be1/be3); start be2 again → it receives traffic again.

Example 2 — Failover: 1 primary origin + 1 backup.

  • Origin Servers: put the primary origin at the top of the list (https://primary.example.com), with the backup origin below it (https://backup.example.com) · Selector: failover · Health Check Type: tcp · Circuit Breaker: on.
  • Result: traffic goes to the first origin in the list (not yet tried) first; when that origin fails or its circuit opens, traffic moves to the next origin. (Failover order follows the order in the list, not the weight values.)
  • How to check: stop the primary origin → requests are still served from the backup; watch the health/circuit state change.

Example 3 — Private, read-only S3 bucket as origin.

  • Origin type: S3 · Access Key ID + Secret · Region ap-southeast-1 · Bucket my-assets · Block write methods: on.
  • Result: GET/HEAD are automatically SigV4-signed at the edge; PUT/DELETE/PATCH are blocked with 405 right at the edge.
  • How to check: curl https://domain/image.jpg → 200 (signed and fetched from S3); curl -X PUT https://domain/image.jpg → 405 with the header Allow: GET, HEAD, OPTIONS.

The circuit breaker requires an active health check. If you turn on Circuit Breaker but leave Health Check Type = none, the circuit never opens (there are no probes to count failures). Always set the type to tcp or http when using the circuit breaker.

Order of evaluation​

  • With multiple origins, the edge first filters by health (passive + active), then applies the selector (origin selection algorithm). If all origins are "unhealthy", the edge falls back to using all of them to avoid dropping 100% of traffic.
  • An origin-rewrite rule (separate page) can carry its own host_header/sni_override/selector/retry settings that override the Upstream configuration for matching paths; the rule's host_header has the highest precedence.

Troubleshooting​

SymptomCauseFix
Save returns 400 "upstream URL is required"No origin enteredEnter at least one valid http(s):// URL
Save returns 400 when TLS to Origin is onThe list contains an http:// URLUse https://, or turn off TLS to Origin
Save returns 400 for an internal IP originThe origin points to a private/loopback addressUse a public address
Circuit Breaker is on but never tripsHealth Check Type = noneSet the type to tcp/http so there are probes
Changing the weight does not change the distributionThe selector does not use weights (e.g. random, ip_hash)Choose weighted_round_robin or failover
S3: signature error / 403 from the bucketWrong Region/Access Key/Secret/EndpointCheck the Region and keys again; for MinIO/GCS set Addressing Style = path

FAQ​

  • How many origins can I declare? Up to 64 URLs per domain.
  • What is the difference between active and passive health checks? Active (tcp/http) means VNIS probes on a regular schedule; passive means an origin is automatically removed temporarily when its actual error rate exceeds 50%. Passive checks always run; the circuit breaker only works together with active checks.
  • Is my S3 secret exposed when I view the configuration again? No — when viewed again, the Secret is shown as ******** and the Access Key is partially masked; if you save while keeping the placeholder, the old key is kept.
  • Does h2 to the origin always work? Only with TLS (ALPN is negotiated over TLS). On http://, h2h1 automatically falls back to H1.
  • How long does a change to the origin's DNS record take to apply? The edge caches resolution results for about 60 seconds.