Skip to content

SafetyNet is the Sherpa.sh zero-risk migration feature that lets you deploy on our platform while keeping your existing provider (Vercel, Netlify, AWS, etc.) as an automatic fallback. Start saving money immediately without the risk of moving everything to a new platform.

Beyond migrations, SafetyNet also serves as a powerful disaster recovery solution. If your primary Sherpa.sh deployment ever experiences issues, traffic automatically fails over to your configured fallback provider without any manual intervention or DNS changes.

SafetyNet uses intelligent edge routing on our CDN to serve traffic from Sherpa.sh by default. If Sherpa.sh ever returns an error, your traffic automatically falls back to your existing deployment - instantly and transparently to your users.

User Request -> Sherpa.sh CDN Edge
|
V
[Sherpa.sh returns success]
|
V
Response served from Sherpa.sh
User Request -> Sherpa.sh CDN Edge
|
V
[Sherpa.sh returns error]
|
V
Automatic fallback to Vercel|Netlify|etc
|
V
Response served from Vercel|Netlify|etc

This approach means you can:

  • Start saving immediately as Sherpa.sh handles your traffic at our flat rate
  • Reduce your Vercel bill as usage drops
  • Keep your existing deployment as a safety net
  • Zero downtime risk during the transition

SafetyNet is ideal if you are:

  • Testing Sherpa.sh with production traffic before fully committing
  • Gradually migrating from another platform without downtime risk
  • Looking to reduce infrastructure costs immediately
  • Wanting to keep your current provider as disaster recovery

Setting up SafetyNet is simple - just enable it from your application settings and configure your fallback URL.

  • An active Sherpa.sh deployment
  • Your existing deployment URL (e.g., your-app.vercel.app)
  1. Navigate to Applications > Your App > SafetyNet in the Sherpa.sh dashboard
  2. Enable SafetyNet for your application
  3. Enter your fallback URL (e.g., https://your-app.vercel.app)
  4. Save your configuration

That is it! SafetyNet is now active and will automatically route traffic to your fallback if Sherpa.sh returns an error.

You can verify that SafetyNet is working correctly by temporarily disabling your Sherpa.sh application:

  1. Navigate to your application settings page
  2. Use the toggle in the upper left of the page to disable your application
  3. Visit your domain - traffic should now be served from your fallback provider
  4. Re-enable your application using the same toggle
  5. Visit your domain again - traffic should now be served from Sherpa.sh

When you disable your application, it suspends on the backend, which causes SafetyNet to automatically activate and route all traffic to your configured fallback URL. This is a safe way to test the failover behavior without any actual errors or downtime.

You can confirm which provider is serving your traffic using these methods:

Check Response Headers: Inspect the HTTP response headers in your browser's developer tools (Network tab). Look for provider-specific headers:

  • Vercel: x-vercel-id, x-vercel-cache
  • Netlify: x-nf-request-id, x-netlify
  • Other providers: Check their documentation for identifying headers

Deploy a Visual Change: A foolproof way to test:

  1. Make a visible change to your application (e.g., add a banner saying "Served from Vercel")
  2. Deploy this change only to your fallback provider (not to Sherpa.sh)
  3. Disable your Sherpa.sh application using the toggle
  4. Visit your domain - you should see the change you deployed to the fallback
  5. Re-enable Sherpa.sh - the change should disappear as traffic returns to Sherpa.sh

Monitor Fallback Provider Logs: Check the access logs or analytics dashboard of your fallback provider (Vercel, Netlify, etc.) to see incoming requests when SafetyNet is active. This confirms traffic is reaching your fallback infrastructure.

Behind the scenes, SafetyNet uses an edge script that runs on our Bunny.net-powered CDN infrastructure:

/**
* Intercepts origin responses and implements fallback logic
*/
async function onOriginResponse(context: {
request: Request,
response: Response
}): Promise<Response> | Response | void {
// If Sherpa.sh returns an error
if (!context.response.ok)) {
const originalUrl = new URL(context.request.url);
// Your fallback URL (Vercel, Netlify, etc.)
const fallbackHost = 'https://your-app.vercel.app';
const newUrl = `${fallbackHost}${originalUrl.pathname}${originalUrl.search}`;
// Forward the request to your fallback provider
const response = await fetch(newUrl, {
method: context.request.method,
headers: context.request.headers,
body: context.request.body,
redirect: context.request.redirect,
integrity: context.request.integrity,
signal: context.request.signal,
credentials: context.request.credentials,
mode: context.request.mode,
referrer: context.request.referrer,
referrerPolicy: context.request.referrerPolicy
});
return response;
}
}

SafetyNet leverages edge scripting technology to run code on our CDN, as close as possible to your users. Here is what makes it powerful:

Scripts run on CDN edge nodes across our global network, minimizing latency by executing closer to end users.

Edge scripts run inside V8 isolates (the same engine powering Google Chrome), providing efficient and secure execution with fast startup times (sub-millisecond) and strong isolation between requests.

SafetyNet works with any application framework or technology stack supported by Sherpa.sh:

  • Next.js, Remix, Nuxt, SvelteKit, etc
  • Docker containers
  • Static sites
  • Custom applications

SafetyNet automatically routes to your fallback provider when:

  • 4xx errors (404, 403, etc.) - Client errors from your Sherpa.sh deployment
  • 5xx errors (500, 502, 503, etc.) - Server errors from your Sherpa.sh deployment
  • Connection timeouts - If Sherpa.sh does not respond
  • Network errors - Any network-level issues

Successful responses (2xx codes, 3xx) are always served from Sherpa.sh.

  • Normal operation: No additional latency - traffic routes directly to Sherpa.sh
  • Fallback activation: Adds 50-150ms for the intitial fallback request
  • Edge decision: Sub-millisecond overhead for the routing logic

SafetyNet runs across our 200+ global CDN edge locations, providing:

  • Low-latency fallback decisions worldwide
  • Regional optimization
  • High availability routing

You can monitor how often SafetyNet activates your fallback by reviewing:

  • CDN access logs in your Sherpa.sh dashboard
  • Response times and error rates
  • Traffic distribution between Sherpa.sh and your fallback provider

As your Sherpa.sh deployment handles more traffic successfully:

  1. Your fallback provider sees decreasing usage
  2. Your bills from the fallback provider decrease proportionally
  3. You can monitor the cost savings in real-time
  4. Once confident, you can remove the fallback entirely

Once you are confident in your Sherpa.sh deployment, you can disable the safety net in the same place you enabled it. But there is no rush - keep SafetyNet active as long as you need it.

ApproachRisk LevelCost Savings StartRollback Speed
SafetyNetMinimalImmediateAutomatic (sub-second)
Standard MigrationHigherAfter full switchManual (DNS propagation)

SafetyNet preserves all aspects of the original request when falling back:

  • HTTP method (GET, POST, PUT, DELETE, etc.)
  • All request headers (authentication, cookies, user-agent, etc.)
  • Request body (for POST/PUT requests)
  • Query parameters and search strings
  • URL path
  • Redirect behavior
  • Request integrity
  • Request signal
  • Credentials
  • CORS mode
  • Referrer and referrer policy

This ensures your fallback provider receives identical requests, maintaining full compatibility with authentication, form submissions, API calls, and any other request-dependent functionality.

  • Edge scripts run in isolated environments
  • No access to sensitive data or credentials
  • Cannot modify your Sherpa.sh or fallback deployments
  • Audit logs available for compliance

Does SafetyNet increase my costs? No. You only pay the Sherpa.sh flat rate. Your fallback provider bills decrease as Sherpa.sh handles more traffic.

How fast is the fallback? Typically 50-150ms to reroute to your fallback provider. Users experience minimal delay.

Can I use multiple fallback providers? Currently SafetyNet supports one fallback URL per deployment.

Does this work with API routes? Yes. SafetyNet works for all HTTP requests, including API endpoints, static assets, and server-rendered pages.

What if my fallback provider has issues? If both Sherpa.sh and your fallback fail, users see the error from the fallback provider. This is the same behavior as if you were only on the fallback provider.

Can I customize which errors trigger fallback? The default configuration falls back on all error responses. Contact support for custom edge script configurations.

Ready to try SafetyNet?

  1. Deploy your app to Sherpa.sh
  2. Navigate to Applications > Your App > SafetyNet
  3. Enable SafetyNet and enter your fallback URL
  4. Start saving money immediately while your existing deployment remains as backup

Questions? Join us on Discord