liu1004010308 commented on issue #12346:
URL: https://github.com/apache/apisix/issues/12346#issuecomment-2984107650

   > "plugins": {
   >   "real-ip": {
   >     "source": "http_x_real_ip"
   >   }
   > }
   
   @mikyll thans your answer, When I set this, if x_real_ip is empty, why does 
APISIX still pass a value for real_ip to the backend? I spent a long time 
researching this, and I feel that this feature is not very user-friendly.
   
   route:
   
{"name":"autoreg_http_yun.test1.cn_81_*_app_446655440000","desc":"","enable_websocket":true,"status":1,"hosts":["yun.test1.cn"],"uris":["*"],"priority":0,"methods":["GET","POST","PUT","PATCH","OPTIONS","HEAD","DELETE","CONNECT","TRACE","PURGE"],"plugins":{"proxy-rewrite":{"headers":{"Upgrade":"$http_upgrade","Connection":"upgrade","Host":"$host","X-Forwarded-For":"$proxy_add_x_forwarded_for"},"use_real_request_uri_unsafe":true},"real-ip":{"source":
 "http_x_real_ip" 
}},"vars":[["server_port","==",81]],"upstream":{"pass_host":"pass","timeout":{"send":7200,"connect":60,"read":7200},"keepalive_pool":{"idle_timeout":60,"size":320,"requests":1000},"scheme":"http","type":"roundrobin","nodes":{"10.217.16.124:10002":50,"10.217.16.238:10002":50},"checks":{"active":{"type":"tcp","timeout":5,"concurrency":10,"http_path":"/","healthy":{"interval":2,"successes":1,"http_statuses":[200,302]},"unhealthy":{"timeouts":3,"interval":5,"http_statuses":[429,404,500,501,502,503,504,505],"http_failures":5
 
,"tcp_failures":3}},"passive":{"type":"http","healthy":{"successes":3,"http_statuses":[200,201]},"unhealthy":{"timeouts":7,"http_statuses":[500],"http_failures":3,"tcp_failures":3}}}},"id":"00000000000000070135"}
   
   apisix logs:
   
![Image](https://github.com/user-attachments/assets/1fe20983-ad1e-4581-b174-f04129ad2d91)
   apisix output:
   
![Image](https://github.com/user-attachments/assets/1fd79b5d-0466-45e2-8a0e-3f57f0882162)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to