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 2020/07/09 02:53:40 UTC

[GitHub] [incubator-apisix] jackwoods opened a new issue #1821: request help: 路由+rewrite+multi-upstream

jackwoods opened a new issue #1821:
URL: https://github.com/apache/incubator-apisix/issues/1821


   ### Issue description
   请教个问题,我有个具体需求,就是路由叫/search/api, 有2个upstream 10.10.10.1:8888, 10.10.10.2:8888,
   需要rewrite:["^/search/api(.*)$","$1"],这种情况下如何在1.3完成这个配置(最佳实践)?多谢!
   
   ### Environment
   
   * apisix 1.3
   * OS: alpine
   


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

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



[GitHub] [incubator-apisix] membphis commented on issue #1821: request help: route+rewrite+multi-upstream

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1821:
URL: https://github.com/apache/incubator-apisix/issues/1821#issuecomment-655869410


   please make a try:
   
   ```shell
   curl -i http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/search/api*",
       "plugins": {
           "proxy-rewrite": {
               "regex_uri": ["^/search/api(.*)$","$1"]
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "10.10.10.1:8888": 1,
               "10.10.10.2:8888": 1
           }
       }
   }'
   ```


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

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



[GitHub] [incubator-apisix] membphis commented on issue #1821: request help: route+rewrite+multi-upstream

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1821:
URL: https://github.com/apache/incubator-apisix/issues/1821#issuecomment-655874642


   > The final question is, to make the upstream reusable, I'd better create an independent upstream, then change it in the admin panel?
   
   you are right.


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

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



[GitHub] [incubator-apisix] jackwoods closed issue #1821: request help: route+rewrite+multi-upstream

Posted by GitBox <gi...@apache.org>.
jackwoods closed issue #1821:
URL: https://github.com/apache/incubator-apisix/issues/1821


   


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

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



[GitHub] [incubator-apisix] membphis commented on issue #1821: request help: route+rewrite+multi-upstream

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1821:
URL: https://github.com/apache/incubator-apisix/issues/1821#issuecomment-655874083


   > I have a question about the route id, we always need to specified it?
   > In the admin panel, if I create a route, then the id will be auto-generated.
   
   you can use `POST` method, same as Dashboard.


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

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



[GitHub] [incubator-apisix] jackwoods edited a comment on issue #1821: request help: route+rewrite+multi-upstream

Posted by GitBox <gi...@apache.org>.
jackwoods edited a comment on issue #1821:
URL: https://github.com/apache/incubator-apisix/issues/1821#issuecomment-655871370


   Another question is: when proxy pass to upstream, some times we need to change the header host to the upstream host, seems not easy to do it.


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

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



[GitHub] [incubator-apisix] jackwoods commented on issue #1821: request help: route+rewrite+multi-upstream

Posted by GitBox <gi...@apache.org>.
jackwoods commented on issue #1821:
URL: https://github.com/apache/incubator-apisix/issues/1821#issuecomment-655871944


   The final question is, to make the upstream reusable, I'd better create an independent upstream, then change it in the admin panel?


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

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



[GitHub] [incubator-apisix] jackwoods commented on issue #1821: request help: route+rewrite+multi-upstream

Posted by GitBox <gi...@apache.org>.
jackwoods commented on issue #1821:
URL: https://github.com/apache/incubator-apisix/issues/1821#issuecomment-655871370


   The other question is: when proxy pass to upstream, some times we need to change the header host to the upstream host, seems not easy to do it.


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

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



[GitHub] [incubator-apisix] jackwoods edited a comment on issue #1821: request help: route+rewrite+multi-upstream

Posted by GitBox <gi...@apache.org>.
jackwoods edited a comment on issue #1821:
URL: https://github.com/apache/incubator-apisix/issues/1821#issuecomment-655871370


   Another question is: when proxy pass to upstream, sometimes we need to change the header host to the upstream host, seems not easy to do it.


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

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



[GitHub] [incubator-apisix] jackwoods commented on issue #1821: request help: route+rewrite+multi-upstream

Posted by GitBox <gi...@apache.org>.
jackwoods commented on issue #1821:
URL: https://github.com/apache/incubator-apisix/issues/1821#issuecomment-655870553


   I have a question about the route id, we always need to specified it? 
   In the admin panel, if I create a route, then the id will be auto-generated.


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

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