Path Passthrough
Path passthrough is a switch in routing rules that controls whether the triggering path is passed through to the backend service when the HTTP Gateway forwards a request.
How It Works
Each route is configured with a triggering path (e.g. /more). When a request matches the route, the gateway decides the path passed to the backend based on the "Path Passthrough" switch:
| Switch Status | Path received by the backend service (resource) |
|---|---|
| Disable path passthrough (default) | The triggering path prefix is stripped, only the matched remainder is passed |
| Enable path passthrough | The full path is passed through (triggering path preserved) |
Example: with triggering path /more, when a user visits https://example.com/more/path:
- Disable path passthrough (default): the backend receives
/path(the/moreprefix is stripped) - Enable path passthrough: the backend receives
/more/path(the full path)
Use Cases
- Backend-managed subpaths: when the backend (e.g. Cloud Run, HTTP Cloud Function) plans its own multi-level paths, enable passthrough so the backend receives the full path and routes it internally
- Unified backend service: when the same backend handles multiple gateway routes, pass through the full path to distinguish the request source
- Prefix-stripping forwarding: when the backend only cares about the business path after the triggering path, keep the default (disabled) so the backend does not need to know the gateway route prefix
How to Use
- Log in to the CloudBase console and go to the HTTP Gateway management page
- In the routing rule list, find the target route and click "Edit"
- Find the "Path Passthrough" switch and enable or disable it as needed
- Changes take effect immediately after saving
Notes
- Path passthrough is disabled by default (
enablePathTransmission: false), in which case the gateway strips the triggering path prefix; when enabled (true), the full path is passed through - Once path passthrough is changed, the
request.pathvalue received by the backend will change. Check the path-handling logic in your backend business code accordingly - If the target resource of the route has identity authentication enabled, the path passthrough rule still applies and the passthrough logic runs after authentication
- Static hosting routes automatically generate path rewrite rules. If you want to enable path passthrough, first check the route's path rewrite configuration to avoid conflicting with the auto-generated rule