Tyk v2.2 Documentation Components

HomeTyk v2.2 Documentation ComponentsURL Rewriter: Context Variables

URL Rewriter: Context Variables

As of version 2.2 Tyk also allows context variables to be injected into the regex using the $tyk_context. namespace instead of the numeric index.

The context variables that are available are:

  • request_data: If the inbound request contained any query data or form data, it will be available in this object, for the URL Rewrite, tyk will format this data as key:value1,value2,valueN;key:value1,value2 etc.
  • path_parts: The compoenents of the path, split on /, again these values are made available in the format of a comma delimited list
  • token: The inbound raw token (if bearer tokens are being used) of this user
  • path: The path that is being requested
  • remote_addr: The IP address of the connecting client
Was this article helpful to you? Yes No