macdoor opened a new issue, #8812:
URL: https://github.com/apache/apisix/issues/8812
### Current Behavior
If the following content is added to config.yaml, the request header cannot
be rewritten
```
plugins:
- log-rotate
```
The route is defined as follows
```
{
"uri": "/g/gw*",
"name": "REST API 18083 prod",
"methods": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"OPTIONS",
"CONNECT",
"TRACE",
"PURGE"
],
"vars": [
[
"server_port",
"==",
"18083"
]
],
"plugins": {
"proxy-rewrite": {
"headers": {
"gem_environment": "prod",
"rest_gw_proxy_port": "$server_port"
}
}
},
"upstream_id": "446753751294806357",
"status": 1
}
```
request headers gem_environment, rest_gw_proxy_port will not be added
### Expected Behavior
The plugins defined in config.yaml should not affect the rewriting of
headers.
### Error Logs
_No response_
### Steps to Reproduce
1. create route
```
{
"uri": "/g/gw*",
"name": "REST API 18083 prod",
"methods": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"OPTIONS",
"CONNECT",
"TRACE",
"PURGE"
],
"vars": [
[
"server_port",
"==",
"18083"
]
],
"plugins": {
"proxy-rewrite": {
"headers": {
"gem_environment": "prod",
"rest_gw_proxy_port": "$server_port"
}
}
},
"upstream_id": "446753751294806357",
"status": 1
}
```
2. start route
headers gem_environment, rest_gw_proxy_port are added to the incoming
request and sent upstream
3. modify conf/config.yaml, and add the following content
```
plugins:
- log-rotate
```
4. reload apisix
headers gem_environment, rest_gw_proxy_port disappeared
### Environment
- APISIX version (run apisix version): 3.1.0 or 2.15.1
- Operating system (run uname -a): 3.10.0-1160.25.1.el7.x86_64
- OpenResty / Nginx version (run openresty -V or nginx -V):nginx version:
openresty/1.21.4.1
- etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
3.5.6
- APISIX Dashboard version, if relevant: 3.0.0 or 2.15.0
- Plugin runner version, for issues related to plugin runners: prometheus,
log-rotate
- LuaRocks version, for installation issues (run 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]