- 2025年05月13日
- 星期二
我使用nginx作为反向代理,我希望它缓存POST请求.我的后端已正确配置为POST请求返回适当的缓存控制头.在nginx我配置了:proxy_cache_methods POST; proxy_cache_key $request_method$request_uri$request_body; 这适用于小型HTTP POST请求.但是我开始注意到对
我有一个API服务器的nginx代理. API有时会设置缓存控制标头.如果API没有设置缓存控件,我希望nginx覆盖它.我怎么做?我想我想做这样的事情,但它不起作用.location /api { if ($sent_http_cache_control !~* max-age=90) { add_header Cache-Control
鉴于下面的示例位置示例,-1表示过期是什么意思?这是否意味着“永不过期”或“永不缓存”?# cache.appcache, your document html and data location ~* .(?:manifest|appcache|html?|xml|json)${ expires -1; access_log logs/stati