Skip to main content
Add an orbitlab.json file to your repository to control how requests to your app are handled—redirects, rewrites, custom headers, trailing-slash behavior, and clean URLs. These rules run at the edge (in front of your app), so they apply before a request ever reaches your container. The file is parsed automatically on every deployment. There is nothing to enable.

Where the file lives

Place orbitlab.json at the root of your project. In a monorepo, put it in the same folder you set as your Root Directory (e.g. apps/web/orbitlab.json). Only the routing keys below are read—any other keys are ignored, so you can safely keep unrelated settings in the same file.

A minimal example

Redirects

Send visitors from one path to another with an HTTP redirect.

Rewrites

Serve content from a different path or another origin without changing the URL in the browser.
  • Internal rewrite — when destination is an absolute path (e.g. /posts/:path*), the URL is rewritten and the request continues to your app.
  • Proxy rewrite — when destination is a full URL (e.g. https://api.example.com/:path*), the request is proxied to that origin. The upstream Host header is set to the destination host, and HTTPS upstreams are supported.

Headers

Attach custom response headers to matching requests. Header rules do not stop the request—after headers are set, it continues on to rewrites and your app.

Trailing slash & clean URLs

  • trailingSlashfalse strips the trailing slash (/about//about); true enforces one (/about/about/) for paths without a file extension. Both use a 308 redirect. The root / is never affected.
  • cleanUrls — redirects /page.html/page with a 308.

Source patterns

The source field supports a familiar path-matching syntax: Named parameters can be reused in destination by writing the same :param token. For example, "/old/:slug""/new/:slug" carries the captured segment across.

Conditions (has / missing)

Both redirects, rewrites, and headers accept optional has and missing arrays to match only when certain request attributes are present (has) or absent (missing).
Each condition object supports:

Per-domain (host) rules

When your service has several domains attached, use a host condition to apply a rule to only one of them. This lets a single app serve different content per subdomain:
orbitlab.json routes within a single service. Host conditions differentiate between domains that are already attached to this service—they can’t send traffic to a different service. To point a domain at a specific service, attach it to that service from the dashboard (see Domains). To reach an external origin, use a rewrite whose destination is a full URL.

Order of evaluation

Rules are applied at the edge in this order, then the request falls through to your app:
  1. cleanUrls
  2. trailingSlash
  3. redirects
  4. headers
  5. rewrites
  6. Your application
Redirects and proxy rewrites are terminal (they stop further processing). Header rules and internal rewrites continue down the chain.

Managing rules from the dashboard

You can also manage routing from the dashboard/API. When both exist, the dashboard configuration takes precedence over the file: rule lists are combined with dashboard rules matched first, and the flags (trailingSlash, cleanUrls) use the dashboard value when set. Removing orbitlab.json from your repo clears the file-based rules on the next deploy, while dashboard rules stay in place.

Limits

To keep edge routing fast, the following limits apply: If orbitlab.json is invalid, the deploy continues and the previous routing rules are kept—check your build logs for a validation warning.