Rewrite URL in route


#1

Hi there! Simple issue, but I can’t slove it:slightly_frowning_face:
How can I rewrite URL?

URL in request to kong: /v2.0/stat
Service: my-service.org/v1.0
Request to service: /v1.0/stat

So, I need to change /v2.0/stat to /stat

Thank you!


#2

@Broglie
Kong can strip path of your request, so you could do something like the following:

- host: my-service.org
  name: name00
  port: 80
  protocol: http
  path: /v1.0/stat
  routes:
  - paths:
    - /v2.0/stat
    preserve_host: false
    protocols:
    - http
    - https
    strip_path: true