Skip to content

Origins & Failover

Your origin is the server nsin fetches your site from. By default that’s whatever your DNS record points at. Two kinds of rule let you do more than that:

  • Origin pool — several servers behind one domain, with health checking and automatic failover.
  • Origin route — send specific paths to a specific server.

Both are edge-side, so you can change them without touching DNS.

A pool is a list of servers nsin may use for the domain, plus how to choose between them.

  1. Go to RulesAdd RuleOrigin Pool.
  2. Add each server: its address, port and whether nsin reaches it over http or https.
  3. Choose how traffic is spread:
MethodWhat it does
Round robinRotates through the servers. Give a server a higher weight to send it a larger share.
Least loadPrefers the server currently handling the least work.
GeographicEach nsin location uses the server you assign to it — visitors are served from the backend nearest to them.
  1. Save.

Turn on health checking and nsin probes each server on a path you choose (/ by default, or a dedicated /healthz) and takes failing servers out of rotation automatically.

You control how often it probes, how long it waits for an answer, how many failures in a row take a server out, and how many successes bring it back. A server that starts failing real requests can also be ejected for a short cool-off period without waiting for the probe.

An origin route sends matching paths to a specific server, leaving everything else alone.

  1. Go to RulesAdd RuleOrigin Route.
  2. Set which paths it applies to (for example /api/*).
  3. Set the server address, port and scheme.
  4. Save.

Split the API off the website

  • /api/*10.0.0.20:8080 over http
  • everything else → your normal origin

Both rule types let you override the host header (and TLS SNI) nsin sends to the origin. Set this when your backend serves several sites and needs to be told which one to answer with — for example an internal server that expects app.internal rather than your public domain.

Leave it empty and nsin sends the hostname the visitor asked for.

Which rule do I want? One site, several identical servers → pool. Different parts of the site on different servers → route. You can use both.

A server in my pool is down — what do visitors see? With health checks on, nothing: the failing server is taken out and traffic goes to the others. Without health checks, some requests will fail until you remove it. Outages are recorded under Uptime.

Can I use hostnames instead of IP addresses? Yes. Bear in mind that nsin then depends on that name resolving correctly.