-
Route path need config the whole path when my request uri is: localhost:8000/api/login route path need: /api/login My nginx.conf is:
I have already config the prefix Dese any body have this problem??? hope someone could help me out, thanks~ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@XJShane The location hack you did not change how Kong views the request path, but just point to a different location block, which does the same thing as the default For various historical reasons from #2366 to #6821, Kong won't use the URI after rewrite (it always uses the original request_uri), thus rewrite it in plugin or template doesn't work. |
Beta Was this translation helpful? Give feedback.
@XJShane The location hack you did not change how Kong views the request path, but just point to a different location block, which does the same thing as the default
/
block. While the use case you described is not a common case in Kong, if you mustuse it in that way, consider using an internal redirect (not rewrite).
For various historical reasons from #2366 to #6821, Kong won't use the URI after rewrite (it always uses the original request_uri), thus rewrite it in plugin or template doesn't work.