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 2022/07/27 03:39:14 UTC

[GitHub] [apisix] wodingyang commented on issue #7522: bug: 在config.yaml的plugins下开启插件导致路由失效

wodingyang commented on issue #7522:
URL: https://github.com/apache/apisix/issues/7522#issuecomment-1196229798

   按以上配置确实返回200,查看我的路由配置,使用了proxy-rewrite对路由进行了改写,具体配置如下:
   {
     "uri": "/javatest/*",
     "name": "测试",
     "methods": [
       "GET",
       "POST"
     ],
     "plugins": {
       "proxy-rewrite": {
         "regex_uri": [
           "/javatest/*",
           "/"
         ]
       }
     },
     "upstream_id": "415336969531294748",
     "labels": {
       "API_VERSION": "v1.0"
     },
     "status": 1
   }
   ,关闭log-rotate插件,返回200,日志信息:
   10.10.16.129 - - [27/Jul/2022:11:35:53 +0800] 192.168.68.114:9080 "GET /javatest/firstwork/ HTTP/1.1" 200 63 0.009 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36 Edg/103.0.1264.71" 10.110.3.50:8888 200 0.009 "http://192.168.68.114:9080/firstwork/"
   ,在config.yaml打开log-rotate插件,返回404,日志信息:
   10.10.16.129 - - [27/Jul/2022:11:36:54 +0800] 192.168.68.114:9080 "GET /javatest/firstwork/ HTTP/1.1" 404 727 0.011 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36 Edg/103.0.1264.71" 10.110.3.51:8888 404 0.011 "http://192.168.68.114:9080"
   
   ![image](https://user-images.githubusercontent.com/75060224/181155534-27e830cd-c7ab-44d2-9951-8c63f58f2671.png)
   对比faxi发现在打开log-rotate插件后,proxy-rewrite插件重写时丢失了uri


-- 
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