Kong Functions (Pre-Plugins)

Add a header to a request based on another header

Use Lua code to check for the existence of a header in a request, and if that header exists, add a new header with the same value.

In this example, we want to check if requests contain a Request-Id header. If it’s present, we want to add a header named New-Request-Id with the same value.

Set up the plugin

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!