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/12/07 07:31:12 UTC

[GitHub] [apisix] imiskolee opened a new issue, #8471: help request: How to change the origial request host?

imiskolee opened a new issue, #8471:
URL: https://github.com/apache/apisix/issues/8471

   ### Description
   
   If we have a site called `www.a.b.com`, and it's already has a lots router rules, then we have the new domain for the site `www.c.d.com`, so how to let the new domain can be works all exists router rules? I am trying `serverless-pre-function` Plugin, but I don't know how to let it work.
   
   ```lua 
   
   disable: false
   functions:
     - |-
       return function(conf,ctx)
       local mapping = {};
       mapping["new_domain"] =  "old_domain";
       if mapping[ngx.var.host] then 
        //what shall we do here...
         ngx.req.set_header('Host', mapping[ngx.var.host]);
       end
       end;
   phase: rewrite
   
   ```
   
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.5.0
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `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.apache.org

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


[GitHub] [apisix] imiskolee closed issue #8471: help request: How to change the origial request host?

Posted by GitBox <gi...@apache.org>.
imiskolee closed issue #8471: help request:  How to change the origial request host?
URL: https://github.com/apache/apisix/issues/8471


-- 
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 #8471: help request: How to change the origial request host?

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

   > and it's already has a lots router rules, then we have the new domain for the site `www.c.d.com`, so how to let the new domain can be works all exists router rules?
   
   Update all existing router which related to `www.a.b.com`. Any hack is not recommended.
   
   


-- 
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] imiskolee commented on issue #8471: help request: How to change the origial request host?

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

   > > and it's already has a lots router rules, then we have the new domain for the site `www.c.d.com`, so how to let the new domain can be works all exists router rules?
   > 
   > Update all existing router which related to `www.a.b.com`. Any hack is not recommended.
   
   thanks. 


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