nfrankel opened a new issue #6504:
URL: https://github.com/apache/apisix/issues/6504


   ### Issue description
   
   ### Use-case
   
   To test a new version of my endpoint, I want to use the [proxy-mirror 
plugin](https://apisix.apache.org/docs/apisix/plugins/proxy-mirror).
   
   The incoming request is `/v1/hello`. I'm using the [proxy-rewrite 
plugin](https://apisix.apache.org/docs/apisix/plugins/proxy-rewrite) to rewrite 
the path to `/hello` before sending it to the upstream. However, the priority 
of `proxy-rewrite` is 1008; the priority of proxy-mirror 1010.
   
   For this reason, the mirroring is first applied, sending `/v1/hello` to the 
mirror host, and only then is the rewrite applied, sending `/hello` to the 
nominal upstream. The mirror returns 404, as it doesn't know about `v1`. I need 
the opposite, first rewrite, then mirror.
   
   ### Alternative solutions
   
   * Change the respective priority of `proxy-mirror` and `proxy-rewrite` to 
execute rewrite before mirror.
   
       **Pro**: easy fix
       **Cons**:
   
       * Breaking change
       * Some users may want to keep the current order
   
   * Move the ordering to configuration. Instead of having the priority in the 
source code, make it a runtime concern.
   
       **Pro**: very flexible
       **Cons**: 
   
       * Breaking change
       * Require configuring the order, even if the current one fits
       
   * Allow to override default order. Keep the default priority in the source 
code, but allows overriding it in configuration
   
       **Pro**:
   
       * Very flexible
       * Compatible with existing usage
   
       **Con**: design and development effort


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to