bogas04 / kong-user-agent-based-routing

Kong plugin to route based on user_agent_header

Home Page:https://luarocks.org/modules/bogas04/kong-user-agent-based-routing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kong User Agent Based Routing

Overview

This plugin will change upstream service based on presence of config header to config destination service.

$ curl -X POST http://kong:8001/services/{service}/plugins \
    --data "name=kong-user-agent-based-routing" \
    --data "config.user_agent_header: is_mweb" \
    --data "config.destination: portal-mweb"
Parameter Description
config.user_agent_header Header to look for in order to route.
config.destination Name of service to route to if header is present.

Installation

Recommended:

$ luarocks install kong-user-agent-based-routing

Optional

$ git clone https://github.com/bogas04/kong-user-agent-based-routing
$ cd /path/to/kong/plugins/kong-user-agent-based-routing
$ luarocks make *.rockspec

About

Kong plugin to route based on user_agent_header

https://luarocks.org/modules/bogas04/kong-user-agent-based-routing

License:Apache License 2.0


Languages

Language:Lua 100.0%