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/15 08:27:33 UTC

[GitHub] [apisix] kongjun01 opened a new issue #4609: request help: I have a domain name: aaa.com wants to proxy directly to bbb.com, by developing the plugin but aaa.com doesn t need to configure information about upstream。

kongjun01 opened a new issue #4609:
URL: https://github.com/apache/apisix/issues/4609


   ### Issue description
   
   I have a domain name: aaa.com wants to proxy directly to bbb.com, by developing the plugin but aaa.com doesn t need to configure information about upstream。
   
   
   ### Environment
   
   Request help without environment information will be ignored or closed.
   
   * apisix version (cmd: `apisix version`):
   * OS (cmd: `uname -a`):
   * OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   * etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
   * apisix-dashboard version, if have:
   * luarocks version, if the issue is about installation (cmd: `luarocks --version`):
   


-- 
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] kongjun01 closed issue #4609: request help: Problem forwarding

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


   


-- 
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] spacewander commented on issue #4609: request help: Problem forwarding

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


   You can configure an upstream with "bbb.com".
   ```
   {
       "type": "roundrobin",
       "nodes": {
           "bbb.com:80": 1
       }
   }
   
   ```
   
   It's impossible to do that without upstream.


-- 
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] kongjun01 commented on issue #4609: request help: Problem forwarding

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


   
   thanks, It is resolved. This is my code for the plugin.
   
   ```
   function _M.rewrite(conf, ctx)
   
       local up_conf = {
           type = "roundrobin",
           nodes = {{ host = 'www.baidu.com', weight = 100 }},
           scheme = 'https',
           hash_on = "vars",
           timeout = {
               connect = 15,
               send = 15,
               read = 15
           }
       }
   
       local route_val = { uri = "/*", host = { 'hao.huhuas.cn' }, id = "reverse_baidu", upstream = up_conf }
       ctx.matched_route = { has_domain = true, value = route_val, modifiedIndex = 'reverse_baidu' }
   
   end`


-- 
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] kongjun01 edited a comment on issue #4609: request help: Problem forwarding

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


   thanks, It is resolved. This is my code for the plugin.
   
   ```
   function _M.rewrite(conf, ctx)
   
       local up_conf = {
           type = "roundrobin",
           nodes = {{ host = 'www.baidu.com', weight = 100 }},
           scheme = 'https',
           hash_on = "vars",
           pass_host= "node",
           timeout = {
               connect = 15,
               send = 15,
               read = 15
           }
       }
   
       local route_val = { uri = "/*", host = { 'hao.huhuas.cn' }, id = "reverse_baidu", upstream = up_conf }
       ctx.matched_route = { has_domain = true, value = route_val, modifiedIndex = 'reverse_baidu' }
   
   end`


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