0

I have the following configuration of service with route in Kong:

- name: test
  host: test-service
  port: 80
  protocol: http
  path: /endpoint/
  routes:
    - name: test_route
      strip_path: true
      preserve_host: true
      paths:
        - /login

I am trying to understand the following behaviour:

  • when I access http://localhost/login, I will end up with the http://localhost/endpoint in my browser
  • however, when I try to access http://localhost/login/test/page, nothing will change and I am still in my browser on http://localhost/login/test/page and the upstream server served my request properly

My expectation was that using http://localhost/login/test/page, my browser will have eventually http://localhost/endpoint/test/page. Apparently I misunderstood it.

I understood that in this case, Kong will use the upstream path as /endpoint/test/page, because I have strip_path: true.

However, how it can be changed in case I want to end up with http://localhost/endpoint/test/page in case I will access http://localhost/login/test/page in my browser?

user1563721
  • 1,373
  • 3
  • 28
  • 46

1 Answers1

0

I test your case in my lab. And it's working.

[07/Aug/2023:06:43:22 +0000] "GET /endpoint/123 HTTP/1.1" 200 5 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) 

When I curl /login/123

toyota Supra
  • 3,181
  • 4
  • 15
  • 19