b1-systems / kong-plugin-urlrewrite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kong urlrewrite

Rewrite a request based on a URL provided by a header. The request will then be made against the provided URL instead of the upstream target that is configured for the service.

This plugin can only be enabled on routes.

Configuration

Enable the plugin on a route

curl -X POST http://{HOST}:8001/routes/{ROUTE}/plugins \
    --data "name=urlrewrite" \
    --data "config.rewrite_header=Rewrite-To"

HOST is the domain for the host running Kong. ROUTE is the id or the name of the route where the plugin should be enabled.

Usage

An example for a request against a route with this plugin:

curl -X GET http://{HOST}:8000/example \
    -H "Rewrite-To: https://httpbin.org/anything"

About

License:Apache License 2.0


Languages

Language:Lua 91.8%Language:Nix 8.2%