Skip to content

Request Rewrite Use Cases

This tutorial covers common use cases for the Request Rewrite phase in Peakhour.IO.

Normalise URLs to Lowercase

This filter converts the request URI path to lowercase:

http.request.uri.set:
  path: ${lower(http.request.uri.path)}

The configuration sets the path of the request URI to its lowercase version.

Add a Query Parameter

This filter adds a query parameter to all requests:

http.request.uri.set:
  path: ${http.request.uri.path}
  query: ${concat(http.request.uri.query, "&source=cdn")}

The configuration sets the query of the request URI by concatenating the existing query with "&source=cdn".

These examples demonstrate how to use the Request Rewrite phase to modify incoming requests before they are processed by subsequent phases.