panhow opened a new issue, #10031:
URL: https://github.com/apache/apisix/issues/10031
### Current Behavior
global_rules not working in stream proxy.
i set a ip-restriction global-rule, not working.
### Expected Behavior
return 403 when ip access by ip not included in whitelist
### Error Logs
_No response_
### Steps to Reproduce
1. Enable stream mode
```yaml
apisix:
stream_proxy:
tcp:
- addr: "80"
```
2. start a http server
```yaml
python2 -m SimpleHTTPServer 8080
```
3. set up a stream_route
```bash
curl 127.0.0.1:9080/apisix/admin/stream_routes/test-routes -XPUT -d '{
"server_port": 80,
"upstream": {
"type": "roundrobin",
"pass_host": "pass",
"scheme": "http",
"nodes": [{
"port": 80,
"host": "127.0.0.1:8080",
"weight": 20
}]
}
}'
```
4. set up a global-rules
```bash
curl 127.0.0.1:9080/apisix/admin/global_rules/whitelist -XPUT -d '{
"plugins": {
"ip-restriction": {
"whitelist": ["127.0.0.1"]
}
}
}'
```
5. test by curl
```bash
curl 127.0.0.1
< HTTP/1.1 200 ok
```
### Environment
- APISIX version (run `apisix version`): 2.15.1
--
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]