https://github.com/optum/kong-path-based-routing
Used to support modifying the routing hostname based on parameters extracted from the request path
https://github.com/optum/kong-path-based-routing
api-gateway kong optum
Last synced: 7 months ago
JSON representation
Used to support modifying the routing hostname based on parameters extracted from the request path
- Host: GitHub
- URL: https://github.com/optum/kong-path-based-routing
- Owner: Optum
- License: apache-2.0
- Created: 2018-06-05T21:54:48.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-06-06T03:55:14.000Z (almost 2 years ago)
- Last Synced: 2025-04-14T15:22:09.242Z (about 1 year ago)
- Topics: api-gateway, kong, optum
- Language: Lua
- Homepage:
- Size: 368 KB
- Stars: 2
- Watchers: 11
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Kong Path-Based Routing
## Overview
This plugin will enable informing the hostname which Kong will route to based on elements in the request URI path. It allows for the concactination of both Regex' performed on the request URI path, and constants to form the routing hostname.
Example:
kong-path-based-routing-plugin 'host_fields' args:
```
[
"$/api/service/(%S+)/",
"$api/service/.*/v(%d+).",
"$api/service/.*/v*..(%d+)",
"-apitest.com"
]
```
on a request URI of https://kong-gateway/api/service/myapp/v1.0
to route with path: "/api"
would route to host:
myapp10-apitest.com/service/myapp/v1.0
The host given in the Service will not be used if this plugin is applied.
## Supported Kong Releases
Kong >= 1.x
## Installation
Recommended:
```
$ luarocks install kong-path-based-routing
```
Optional
```
$ git clone https://github.com/Optum/kong-path-based-routing
$ cd /path/to/kong/plugins/kong-path-based-routing
$ luarocks make *.rockspec
```
## Configuration
The plugin requires that regex's/constants be concatinated in the parameter "host_fields" to inform the upstream hostname.
Strings given in the array begining with "$" will be treated as REGEX' to be applied to the URI path.
## Maintainers
[jeremyjpj0916](https://github.com/jeremyjpj0916)
[rsbrisci](https://github.com/rsbrisci)
Feel free to open issues, or refer to our Contribution Guidelines if you have any questions.