Host redirect
Redirect requests to a different host.
For more information, see the Kubernetes Gateway API documentation.
Before you begin
Follow the Get started guide to install Gloo Gateway, set up a gateway resource, and deploy the httpbin sample app.
Get the external address of the gateway and save it in an environment variable.
Set up host redirects
Create an HTTP route for the httpbin app that you created as part of the Get started guide. In the following example, requests for the
host.redirect.example
domain are redirected to thewww.example.com
hostname, and a 302 HTTP response code is returned to the user.Send a request to the httpbin app on the
host.redirect.example
domain and verify that you get back a 302 HTTP response code and the redirect locationwww.example.com/headers
.Example output:
Cleanup
You can optionally delete the HTTP route that you created as part of this guide.