Docs / Sarpius Router

Sarpius Router

Sarpius Router is the edge reverse proxy that sits in front of every app you deploy. It terminates HTTP and HTTPS, issues and renews TLS certificates through Let's Encrypt, resolves each incoming request to an app by hostname and path, and forwards it to a healthy container. Every app gets a working subdomain automatically, and you can attach your own custom domain with managed TLS on top.

What Sarpius Router is

When you deploy an app on Sarpius, its container never faces the public internet directly. Sarpius Router is the single edge that all traffic passes through. It reads the request host, looks up which app owns that hostname, matches the request path against that host's routing rules, picks a healthy upstream for the chosen app, and proxies the response back. TLS is terminated at the edge, so your app does not manage certificates itself.

  • Terminates HTTP and HTTPS at the edge and forwards to your app over the internal network.
  • Issues and renews Let's Encrypt certificates automatically for every routed hostname.
  • Routes by hostname first, then by longest matching path prefix within that host.
  • Balances across healthy upstreams and passively drops upstreams that fail to respond.
  • Serves clear diagnostic pages when an app is unreachable, paused, or unknown.
Remarque

Sarpius Router is one of the engines underneath the platform. Most of the time you interact with routing from inside a Project, and reach the standalone Sarpius Router console through the Advanced menu when you need direct control over domains and rules.

Subdomains and custom domains

Sarpius Router tracks two kinds of hostname, shown as a badge in the console. Both are served the same way at the edge; they differ in how they are created and what you can change.

  • Subdomain: an automatically generated hostname on the platform domain, created for you when an app is deployed. It is locked to the app it belongs to, so its primary app cannot be reassigned from the console.
  • Custom domain: a hostname you own and point at the platform yourself. You choose its primary app, add path rules, and can delete it. Sarpius Router issues and renews its TLS certificate for you.

Every app always has a working subdomain, so you never have to configure DNS just to see your app live. A custom domain is an addition on top of that, not a replacement for it.

Add a custom domain

Attaching your own domain takes two moves: register the hostname in the console and point its DNS at the platform edge. Once DNS resolves to Sarpius Router, the certificate is issued automatically with no further action from you.

  1. Open the Sarpius Router console (from the Advanced menu, or go to /synthrouter) and choose New domain.
  2. Enter the exact hostname you want to serve, for example shop.brand.io, and pick the primary app that should receive its traffic.
  3. At your DNS provider, create a record that points that hostname at the platform edge: a CNAME for a subdomain, or an ALIAS / apex A record for a bare root domain.
  4. Wait for DNS to propagate. Sarpius Router runs the ACME HTTP-01 challenge over port 80 and the certificate status moves from pending to active on its own.
  5. If the app is split across several components, add path rules on the domain detail page to route prefixes such as /api to the right component.
Attention

Certificate issuance needs the hostname to actually resolve to Sarpius Router and be reachable over plain HTTP, because Let's Encrypt validates ownership with an HTTP-01 challenge. If DNS is not pointed yet, or the record points somewhere else, the certificate stays pending until validation can complete.

Automatic TLS

Sarpius Router runs its own ACME client against Let's Encrypt. You never upload a certificate or a private key. When a hostname needs a certificate, the router requests one, completes the HTTP-01 challenge, stores the certificate with its private key encrypted at rest, and starts serving it. The correct certificate is selected per request by SNI.

The domain detail page shows the current certificate state so you can see exactly where issuance stands:

  • active: a valid certificate is installed and serving traffic.
  • pending: issuance is in progress, usually waiting on DNS or the validation challenge.
  • failed: the last issuance attempt did not complete; the failure reason is shown, and the router retries automatically after a short backoff.

Renewal is automatic. A background loop scans installed certificates and renews any that expire within the next 30 days, so a live certificate is refreshed well before it lapses. The detail page also surfaces the issued date, the expiry date, and when the router last checked the certificate.

Remarque

If an initial issuance fails, you do not need to redeploy or restart anything. A periodic sweep re-attempts hostnames that still lack an active certificate, spacing out retries to stay within Let's Encrypt rate limits.

Routing rules

Each domain has one primary app and an optional set of path rules. The primary app is the catch-all: any request that does not match a more specific rule goes there. Path rules let a single hostname fan out to several apps, which is how a multi-component project serves a front-end and a back-end under one domain.

Matching is by longest path prefix. The router compares the request path against every rule on the host and the most specific prefix wins, falling through to the catch-all when nothing else matches.

text
/            ->  web          (catch-all, the primary app)
/api         ->  backend      (everything under /api)
/api/v2      ->  backend-v2    (longer prefix, wins over /api)

Each rule points a path prefix at one app and has a strip-prefix option. With strip prefix on, the matched prefix is removed before the request reaches the app, so /api/users arrives at the back-end as /users. With it off, the app receives the full original path. The catch-all rule always serves the whole path and cannot strip.

  • A path prefix must start with a slash, for example /api.
  • The bare / prefix is the implicit catch-all and is managed through the primary app selector, not added as a separate rule.
  • Turn on strip prefix when the target app expects paths relative to its own root rather than the public prefix.

How a request is resolved

Understanding the order of resolution makes the diagnostic pages easy to read when something is off:

  1. The router reads the request host, lowercases it, and strips any port.
  2. It looks up the domain by hostname. No match returns a diagnostic page identifying the unknown host.
  3. It checks the domain status. A suspended, stopped, or offline app returns a paused page rather than a broken connection.
  4. It matches the path against the domain rules by longest prefix, falling through to the primary app.
  5. It selects a healthy upstream for the chosen app and forwards the request, optionally stripping the prefix first.

Upstream health is tracked passively. When a container fails to connect or times out, the router marks that upstream unhealthy for a short cooldown and rotates to another; a successful response marks it healthy again. Across multiple upstreams for one app, requests are balanced round-robin.

Remarque

The diagnostic pages render the Browser to Sarpius Router to App chain with a status for each hop, and are always sent as HTTP 200 with the real status in an X-Sarpius Router-Status header. That is deliberate: a CDN in front of the platform would otherwise swap our detailed page for its own generic error.

Common tasks

  • Change where a custom domain sends its traffic: open the domain and pick a different primary app. Subdomains are locked to their app and cannot be reassigned.
  • Route a path to another component: add a path rule mapping the prefix, for example /api, to that component's app.
  • Fix a rule that lands at the wrong root: toggle strip prefix so the app receives the path it expects.
  • Check certificate health: open the domain and read the TLS section for status, issued and expiry dates, and any failure reason.
  • Remove a custom domain: delete it from the domain detail page. This revokes its certificate and removes its routing rules. Subdomains cannot be deleted on their own.
Remarque

Route changes take effect almost immediately. Sarpius Router refreshes its in-memory routing on change events, with a periodic full reload as a backstop, so a new rule or a deleted domain stops being served within moments rather than needing a restart.

Edge response cache

The router can cache responses from a container app at the edge, so a repeat request is answered without reaching your app. It is off by default and is switched on per app, in the Cache tab of the app (or with the cache routes of the REST API, which need apps:write). It applies to container apps; the static-bucket path has its own, separate cache.

  • Standard: responses are kept in the memory of the router. By default an object is cached only when its body is at most 512 KiB. Cache hits are counted as ordinary egress, exactly as before.
  • Premium: adds a disk layer behind the memory layer, with a larger per-object ceiling (32 MiB by default), and can serve a stale copy while it refreshes in the background. Bytes served from the cache do not use up your bandwidth bundle; the Cache tab shows the gigabytes served from cache this month. A background refresh is not metered.
  • Both plans are paid. The price per plan is shown in the Cache tab when you pick it, read from the live rate table; this page does not repeat it.
  • Default TTL: between 1 and 86400 seconds, used for a cacheable request that matches no rule. A Cache-Control s-maxage or max-age from your app wins over a rule, a rule wins over the default, and nothing is kept longer than 24 hours.
  • Rules: a path prefix with the mode Cache (optionally its own TTL) or Bypass. The longest matching prefix wins, and a tie goes to Bypass. Rules need a plan to be set first.
  • Purge: one button purges everything cached for the app. There is no per-path purge yet. A purge is recorded in the database, so even if the live notification to the routers is missed they pick it up on their next periodic reload.
  • Statistics: hits, misses, bypasses and stale hits over the last 7 days, shown for display only; billing does not read them.

What is never answered from, or stored in, the cache, whatever your rules say:

  • Any request that carries a Cookie header, and any request with an Authorization header. This cannot be lifted by a rule: an app that personalises a page from a session cookie does not always send Set-Cookie or private on that page, so the only safe line is the request header.
  • Anything other than GET, including HEAD.
  • Range, If-Range, If-None-Match and If-Modified-Since requests, and a request from a client that sends Cache-Control: no-cache, max-age=0 or Pragma: no-cache.
  • A response whose status is not 200, 301, 308 or 404, a response with Set-Cookie, with Cache-Control private, no-store, no-cache or must-revalidate, or with a Vary header other than Accept-Encoding.
Attention

A rule set to Cache only gives a TTL to requests that are already cacheable. It cannot make a signed-in page, or any request that carries a cookie, cacheable. If your public pages are always requested with a cookie (an analytics or consent cookie, for example), they will always bypass the cache.

Not done yet: purging a single path or tag, and caching of non-GET requests. Cache limits (object size, total size) are platform settings, not something you can change per app.

Limits and notes

  • A custom domain is a paid add-on. The subdomain that ships with every app is included; see the pricing and custom-domains guides for how custom domains are billed.
  • You control the DNS for your own domain. The platform issues and renews the certificate, but pointing the record at the edge, and removing it later, is done at your DNS provider.
  • Deleting a custom domain revokes its certificate and drops its rules; the DNS record you created remains yours to remove.
  • A custom domain is associated with an app through its primary app. Removing the app it points at also removes the domain and its certificate.
Attention

Broad WebSocket passthrough for arbitrary user apps is still being rolled out at the edge. If your app relies on long-lived WebSocket connections on a custom domain, confirm current support before depending on it.

Sarpius est un nom commercial de Synthwave-technologies.nl · KvK 73239038 · n° TVA NL002410192B67 · Apeldoorn, Pays-Bas

(c) 2026 Sarpius. Tous droits réservés.

Hébergé dans l'UE