HTTPProxy using a RequestRedirect filter.
AI Edge enforces HTTPS by default. This guide applies when you have disabled that enforcement, or when you need a custom redirect configuration — for example, redirecting from a specific path or returning a
302 instead of the default 301.Overview
ARequestRedirect filter responds to the client with a redirect response directly — no backend is reached. The AI Edge handles the redirect at the proxy layer.
At a high level, this setup:
- Matches all incoming requests on a hostname
- Returns a
301 Moved Permanentlyredirect to the same URL usinghttps
Prerequisites
datumctlinstalled and authenticated- A valid Project
- An existing
HTTPProxyhostname, or create a new one with this guide
Configuration Steps
Step 1: Set Variables
Windows (PowerShell)
macOS / Linux
Step 2: Apply the Redirect Configuration
TheRequestRedirect filter requires type: RequestRedirect. No backend is needed — the redirect is returned immediately by the proxy.
Windows (PowerShell)
macOS / Linux
Verification
Test that a plain HTTP request receives a redirect:Location header uses https and preserves the path.
Cleanup
Windows (PowerShell)
macOS / Linux
Troubleshooting
| Symptom | Root Cause | Resolution |
|---|---|---|
| API rejects the resource | type field missing from filter | Add type: RequestRedirect to the filter |
| Redirect loop | Both HTTP and HTTPS rules redirect | Ensure the redirect rule only targets HTTP traffic |
Location header has wrong hostname | Hostname not set | Add hostname to requestRedirect to override |
Client receives 302 instead of 301 | Default or explicit statusCode: 302 | Set statusCode: 301 for a permanent redirect |
Best Practices
- Use
statusCode: 301for permanent redirects — browsers and crawlers cache these - Use
statusCode: 302only when the redirect is temporary (e.g., maintenance) - If redirecting to a different hostname, set
requestRedirect.hostnameexplicitly rather than relying on theHostheader
Summary
- HTTP to HTTPS redirects use
type: RequestRedirectwithscheme: https - The
typefield is required on all filters - No backend is needed —
RequestRedirectis a terminal filter that responds to the client directly statusCodeaccepts301(permanent) or302(temporary)