Why do I see 307 Internal Redirect in Chrome DevTools?
Your browser has an active Strict-Transport-Security (HSTS) policy for that domain and automatically upgraded an http:// request to https:// before sending it over the network.
HTTP 307 Temporary Redirect guarantees the HTTP method and request body remain unchanged when redirected. You will also see `307 Internal Redirect` in Chrome DevTools when HSTS upgrades HTTP to HTTPS locally.
location = /api/v1/webhook {
return 307 https://api.example.com/api/v2/webhook;
}
curl -i -sS -X POST -d '{"ping":true}' -H 'Content-Type: application/json' https://api.example.com/api/v1/webhook
Your browser has an active Strict-Transport-Security (HSTS) policy for that domain and automatically upgraded an http:// request to https:// before sending it over the network.
No. The Fetch specification forbids redirects on CORS preflight OPTIONS responses; answer OPTIONS with 204 directly on the target URL.
Use 307 for temporary maintenance or canary routing, and 308 when the new API endpoint URL is permanent.