pawarJayesh8511 opened a new issue #4921:
URL: https://github.com/apache/apisix/issues/4921
### Issue description
I have added the real-ip plugin in the config.yml file as follows:
plugins: # plugin list (sorted by priority)
- real-ip # priority: 23000
Execution:
curl -i http://127.0.0.1:9080/apisix/admin/routes/323 -H 'X-API-KEY:
xxxxxxxxxx -X PUT -d '
{
"uri": "/api/realip",
"plugins": {
"real-ip": {
"source": "arg_realip",
"trusted_addresses": ["127.0.0.0/24"]
},
"response-rewrite": {
"headers": {
"remote_addr": "$remote_addr",
"remote_port": "$remote_port"
}
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"xxx.xxx.xx.1:9282": 1
}
}
}'
Output:
{"error_msg":"unknown plugin [real-ip]"}
### Environment
- apisix version (cmd: apisix version): 2.8
- OS (cmd: uname -a): Linux my-machine 5.11.0-27-generic
- conf: removed user resty and add server header. #29~20.04.1-Ubuntu SMP Wed
Aug 11 15:58:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
- OpenResty / Nginx version (cmd: nginx -V or openresty -V): nginx version:
openresty/1.19.9.1
- etcd version, if have (cmd: run curl http://127.0.0.1:9090/v1/server_info
to get the info from server-info API): 3.4.0
- apisix-dashboard version, if have: 2.7
- luarocks version, if the issue is about installation (cmd: luarocks
--version): 3.4.0
### Steps to reproduce
curl -i http://127.0.0.1:9080/apisix/admin/routes/323 -H 'X-API-KEY:
xxxxxxxxxx -X PUT -d '
{
"uri": "/api/realip",
"plugins": {
"real-ip": {
"source": "arg_realip",
"trusted_addresses": ["127.0.0.0/24"]
},
"response-rewrite": {
"headers": {
"remote_addr": "$remote_addr",
"remote_port": "$remote_port"
}
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"xxx.xxx.xx.1:9282": 1
}
}
}'
### Actual result
{"error_msg":"unknown plugin [real-ip]"}
### Error log
nothing in error log
### Expected result
It should accept the real-ip
--
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]