caozhi6655 commented on issue #7363:
URL: https://github.com/apache/apisix/issues/7363#issuecomment-1173254929

   > Yes I tested it, `ngx.req_set_header` is ok. So we can implement X-Real-IP 
settings through the` proxy-rewrite` plugin. Like:
   > 
   > ```json
   > {
   >     "methods": ["POST", "GET"],
   >     "uri": "/helloworld.Greeter/Echo",
   >     "plugins": {
   >         "proxy-rewrite": {
   >             "headers": {
   >                 "X-Real-IP": "$remote_addr"
   >             }
   >         }
   >     },
   >     "upstream": {
   >         "scheme": "grpc",
   >         "type": "roundrobin",
   >         "nodes": {
   >             "127.0.0.1:50051": 1
   >         }
   >     }
   > }
   > ```
   > 
   > However, as @tokers said, maybe we should move some [header setting 
related 
logic](https://github.com/apache/apisix/blob/master/apisix/cli/ngx_tpl.lua#L702-L725)
 to lua to get better compatibility.
   
   I understand,thanks very much!


-- 
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-unsubscr...@apisix.apache.org

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

Reply via email to