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/03/07 13:53:24 UTC

[GitHub] [apisix] lizj3624 opened a new issue #6535: request help: How add customized http header via apisix?

lizj3624 opened a new issue #6535:
URL: https://github.com/apache/apisix/issues/6535


   ### Issue description
   
   I want to add customized http request header from apisix to upstream in some routes,how i can do?
   
   for example:  i want to add `X-My-Header: MyName`,i known nginx's cmd,add `proxy_set_header X-My-Header MyName`
   in  server block
   
   
   ### Environment
   
   - 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:
   - the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
   - 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] juzhiyuan closed issue #6535: request help: How add customized http header via apisix?

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


   


-- 
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] soulbird commented on issue #6535: request help: How add customized http header via apisix?

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


   You can use proxy-rewrite plugin, like:
   ```
   curl http://127.0.0.1:9080/apisix/admin/routes/1  -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "methods": ["GET"],
       "uri": "/test/index.html",
       "plugins": {
           "proxy-rewrite": {
               "uri": "/test/home.html",
               "scheme": "http",
               "host": "iresty.com",
               "headers": {
                   "X-My-Header": "MyName"
               }
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "127.0.0.1:80": 1
           }
       }
   }'
   ```
   You can check the documentation for more details. https://github.com/apache/apisix/blob/master/docs/zh/latest/plugins/proxy-rewrite.md


-- 
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] lizj3624 commented on issue #6535: request help: How add customized http header via apisix?

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


   Thank you very much! I try


-- 
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] juzhiyuan commented on issue #6535: request help: How add customized http header via apisix?

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


   I'm going to close this issue 🤗 If you have other questions, please let us know.


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