You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/07/05 10:07:27 UTC

[GitHub] [apisix] StretchV opened a new issue #4536: request help: apisix似乎没有类似空中strip_path

StretchV opened a new issue #4536:
URL: https://github.com/apache/apisix/issues/4536


   ### Issue description
   我想在apisix中将请求的path中前一部分截取掉然后传入到上游,但是apisix中似乎只有proxy_rewrite这个插件,但是路径中往往会有'%2F'这样的转义符号,例如:http://XXX.myscrm.cn/服务名/api/projects/qweqwe%2Fqweqwe/master/files/proto%2Fsource
   这样的请求,url中的"qweqwe%2Fqweqwe"这对于服务来讲其实是一种参数,而这种请求在被proxy_rewrite重写后,"%2F"就会被转义成"/",这样请求到服务后就会出问题,所以我希望能在apisix中找到类似kong中strip_path这类的方法,就是单纯的将path一部分截取掉然后传入上游,请问有这样的插件吗
   
   ### Environment
   
   Request help without environment information will be ignored or closed.
   
   * apisix version (cmd: `apisix version`):2.3
   
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] StretchV commented on issue #4536: request help: apisix似乎没有类似kong中strip_path这样的方法或插件

Posted by GitBox <gi...@apache.org>.
StretchV commented on issue #4536:
URL: https://github.com/apache/apisix/issues/4536#issuecomment-874407321


   @Yiyiyimu   你好,用regex_uri这个属性是不可以的,因为我不止是希望去掉前缀,而且我还希望path不被转义,因为我的业务中有类似http://www.XXXX.com/foo/qqqq%2Fqqqq/www,这样的请求,这种请求一被regex_uri之后,%2F就会被转义成"/",后端接受到的路径就是http://www.XXXX.com/qqqq/qqqq/www了,所以这种正则的重写方式是不可以的,所以我想问下有没有那种直接截断式的,但是我并没有在apisix中找到类似的方法


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] StretchV closed issue #4536: request help: apisix似乎没有类似kong中strip_path这样的方法或插件

Posted by GitBox <gi...@apache.org>.
StretchV closed issue #4536:
URL: https://github.com/apache/apisix/issues/4536


   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass edited a comment on issue #4536: request help: apisix似乎没有类似kong中strip_path这样的方法或插件

Posted by GitBox <gi...@apache.org>.
tzssangglass edited a comment on issue #4536:
URL: https://github.com/apache/apisix/issues/4536#issuecomment-874454658


   `%2F` has a special meaning in URL encoding, after decoding it is `/`.
   I think you should change this uri to not contain `%2F`.
   You'll need to implement it yourself if you truncate it directly.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Yiyiyimu commented on issue #4536: request help: apisix似乎没有类似kong中strip_path这样的方法或插件

Posted by GitBox <gi...@apache.org>.
Yiyiyimu commented on issue #4536:
URL: https://github.com/apache/apisix/issues/4536#issuecomment-874272802


   Hi @StretchV actually we are using `proxy_rewrite` to implement this for now. Maybe you could refer to this:
   https://github.com/apache/apisix/blob/master/docs/en/latest/FAQ.md#how-to-strip-route-prefix-for-path-matching


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] StretchV closed issue #4536: request help: apisix似乎没有类似kong中strip_path这样的方法或插件

Posted by GitBox <gi...@apache.org>.
StretchV closed issue #4536:
URL: https://github.com/apache/apisix/issues/4536


   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] StretchV commented on issue #4536: request help: apisix似乎没有类似kong中strip_path这样的方法或插件

Posted by GitBox <gi...@apache.org>.
StretchV commented on issue #4536:
URL: https://github.com/apache/apisix/issues/4536#issuecomment-874457313


   好的谢谢


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass edited a comment on issue #4536: request help: apisix似乎没有类似kong中strip_path这样的方法或插件

Posted by GitBox <gi...@apache.org>.
tzssangglass edited a comment on issue #4536:
URL: https://github.com/apache/apisix/issues/4536#issuecomment-874454658


   `%2F` has a special meaning in URL encoding, after decoding it is `/`.
   I think you should change this uri to not contain `%2F`.
   You'll need to implement it yourself if you truncate it directly.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #4536: request help: apisix似乎没有类似kong中strip_path这样的方法或插件

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #4536:
URL: https://github.com/apache/apisix/issues/4536#issuecomment-874454658


   `%2F` has a special meaning in URL encoding, after decoding it is `/`.
   I think you should change this uri to not contain `%2F`.
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Yiyiyimu commented on issue #4536: request help: apisix似乎没有类似kong中strip_path这样的方法或插件

Posted by GitBox <gi...@apache.org>.
Yiyiyimu commented on issue #4536:
URL: https://github.com/apache/apisix/issues/4536#issuecomment-874272802


   Hi @StretchV actually we are using `proxy_rewrite` to implement this for now. Maybe you could refer to this:
   https://github.com/apache/apisix/blob/master/docs/en/latest/FAQ.md#how-to-strip-route-prefix-for-path-matching


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] StretchV commented on issue #4536: request help: apisix似乎没有类似kong中strip_path这样的方法或插件

Posted by GitBox <gi...@apache.org>.
StretchV commented on issue #4536:
URL: https://github.com/apache/apisix/issues/4536#issuecomment-874407321






-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #4536: request help: apisix似乎没有类似kong中strip_path这样的方法或插件

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #4536:
URL: https://github.com/apache/apisix/issues/4536#issuecomment-874454658


   `%2F` has a special meaning in URL encoding, after decoding it is `/`.
   I think you should change this uri to not contain `%2F`.
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org