Static sites

Serve SPAs and static builds from nginx, with redirects, rewrites and headers.

Static sites serve SPAs and static builds from a lightweight nginx edge with HTTPS. You don't run or manage a server process.

Create a site#

  1. 1

    New site

    On the Static hosting page, click “New site”.

  2. 2

    Point at a repo

    Optionally choose a project, name the site, and enter its Git URL.

  3. 3

    Set the output directory

    Enter the folder your build produces (default dist).

Framework presets#

In Settings, pick a framework preset to prefill the build command and output directory:

Vite
npm run build → dist
Next.js (static export)
npm run build → out
Create React App
npm run build → build
Astro
npm run build → dist

Redirects, rewrites & headers#

The routing editor in Settings lets you add rules that nginx applies on the next deploy:

  • Redirects send /old to /new, optionally as a permanent 301.
  • Rewrites serve one path under another, for example /api/(.*) to /proxy/$1.
  • Headers attach response headers to a path, for example X-Frame-Options: DENY on /.

✦ Your static build is served from the edge with HTTPS and your own redirect, rewrite, and header rules.