You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "23557544 (via GitHub)" <gi...@apache.org> on 2024/11/15 02:39:54 UTC
[I] help request: 使用proxy-cache插件如何获取自定义header [apisix]
23557544 opened a new issue, #11748:
URL: https://github.com/apache/apisix/issues/11748
### Description
```
{
"id": "test-1107-weather-3",
"uri": "/api/test/weather/cache2disk",
"plugins": {
"proxy-rewrite": {
"uri": "/api/tianqi/tqyb.php"
},
"proxy-cache": {
"cache_strategy": "disk",
"cache_zone": "disk_cache_default",
"cache_key": ["$http_token", "$request_uri", "$request_body", "-cache-id"],
"cache_ttl": 60,
"cache_method": ["GET", "POST"],
"cache_http_status": [200]
}
},
"methods": ["GET"],
"priority": 10,
"upstream": {
"type": "roundrobin",
"nodes": {
"cn.xxx.cn:443": 1
},
"scheme": "https"
}
}
```
定义`cache_key`时,无法通过`$http_token`获取请求头中的token值,实际调用时token传入不同的值都会命中缓存。
想问下`cache_key`如何获取自定义请求头?
### Environment
- APISIX version (run `apisix version`): 3.11.0
- Operating system (run `uname -a`): Linux rancher0 3.10.0-693.el7.x86_64
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`): openresty/1.25.3.2
- etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`): 3.5.16
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- 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: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: how to get custom header using proxy-cache plugin [apisix]
Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #11748:
URL: https://github.com/apache/apisix/issues/11748#issuecomment-2908858216
If there is still a problem, please open it again.
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: how to get custom header using proxy-cache plugin [apisix]
Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop closed issue #11748: help request: how to get custom header using proxy-cache plugin
URL: https://github.com/apache/apisix/issues/11748
--
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-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org