Direct response
Directly respond to incoming requests without routing the requests to services in your service mesh.
Rather than routing a request to a service within your service mesh, you can send back a pre-defined body and HTTP status response to the client. If necessary, you can also specify headers by using the Header Modification feature in the enclosing route.
For more information, see the Gloo Mesh Gateway API docs for route tables.
Create a virtual gateway that opens up port 80 on your ingress gateway.
Create a direct response route table, and specify the status and optional body that is returned. In the following example, the
510
status andno longer supported
message are immediately returned in response to any requests to the/unsupported-app
path.Get the external address of your ingress gateway.
Verify that you receive the expected direct response by curling the ingress gateway address and, if applicable, the path. For example, the following command appends
/unsupported-app
.