Quick answer: Mockoon's fallback behavior runs at two layers. The environment proxy forwards any request whose path matches no declared route, while route fallback hands off a request that hit a route but matched none of its response rules. Both end at the target URL you configure, and route fallback returns 404 if the proxy is switched off.

Two fallbacks at different levels

The two mechanisms answer different questions, so they are configured in different places. The environment proxy covers requests that never reach a route at all. Route fallback covers requests that reach a route but do not satisfy any of its rules. For the wider choice between this selective layer and other mock tools, the comparison hub frames the trade-offs.

Layer What triggers it Where the request goes Proxy required
Environment proxy No route path matches the request Target URL, same method and body It is the proxy itself
Route fallback A route matches but no response rule does Next declared route, then the target Yes, otherwise it can return 404

How the environment proxy resolves a request

Open the Environment Proxy tab, check Enable proxy mode, and enter the target URL. A shield icon appears next to the environment name. The routes you declared are still intercepted as usual, and everything else is forwarded to the target.

Two settings shape the forwarded call. By default the API prefix stays on the outgoing path, so a mock served under /api/v1 calls the target under /api/v1. Tick Remove prefix when the target expects the path without it. Proxy request headers are added to the outgoing call, which helps when the target needs a fixed header, and proxy response headers are attached to the answer that comes back. If the target answers with a body compressed by gzip, deflate, brotli or Zstandard, Mockoon decompresses it before returning it to the client, so the Logs view shows the uncompressed body.

When route fallback hands off

On a route with several rule-driven responses, enable the fallback icon next to the response list. When none of the rules match, the server ignores the default response and jumps to the next route in declaration order, and finally to the proxied server. This is how you build a guard route such as GET /users/* that demands an Authorization header while GET /users/:id stays open.

Two constraints apply. Fallback cannot combine with the random or sequential response modes, and with no proxy enabled a request that falls through can surface as 404 because there is nowhere to hand it off.

Failure modes worth checking

The proxy is a selective layer in front of a real system, not a replacement for it. If the target is unreachable, every forwarded request fails even though your local routes still answer. Authentication is not invented: the client's Authorization header has to reach the target, or you add it as a proxy request header. A common bug is leaving the prefix on when the target does not expect it, which produces 404s that look like proxy failures. And because fallback skips the default response, a route you assumed always answered locally can pass through to the backend when no rule matches.

To confirm the endpoints you kept local still agree with the real contract, Powerduck organizes the same calls into ordered scenario runs against a live target and asserts status, headers and fields at each step, so the mock and the backend do not quietly diverge.

Frequently asked questions

Do I need the proxy for route fallback to work? Yes. Without it, a request that matches no rule can return 404 since there is nowhere to hand off.

Why does the target return 404 for forwarded calls? The API prefix is forwarded by default. Tick Remove prefix if the target expects the path without it.

Does the proxy add authentication? No. The original Authorization header passes through, or you set a fixed proxy request header.

What happens to the default response in fallback mode? It is ignored, so a request with no matching rule moves on rather than returning it.

The bottom line

Pick the layer by what failed. A path that does not exist in the mock is the environment proxy's job; a path that exists but whose rules all miss is route fallback's job. Design them together, keep the target reachable and the prefix correct, and treat the setup as a thin selective layer that hands most traffic to the real backend while you control only the endpoints that need it.