我正在尝试缓存我编写的reverse_proxy的响应。但是,我总是会想念的。在http块下的代码如下
proxy_cache_path /mnt/nginx/cache levels=1:2 keys_zone=fatcache:8m max_size=1000m inactive=600m;
proxy_cache_key "$request_uri";
proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
server {
listen 8080;
location ~ ^/API/(healthCheck|jobs) { # No rate limiting, no caching
proxy_cache fatcache;
proxy_buffering on;
add_header X-Proxy-Cache $upstream_cache_status;
proxy_cache_valid any 60m;
proxy_pass http://api;
}
}
我总是得到的答复是:
$$$$ curl -v -X GET 'http://<ip>:8080/API/healthCheck'
* About to connect() to <ip> port 8080 (#0)
* Trying <ip>...
* Connected to 1<ip> (1<ip>) port 8080 (#0)
> GET /API/healthCheck HTTP/1.1
> User-Agent: curl/7.29.0
> Host: <ip>:8080
> Accept: */*
>
< HTTP/1.1 200
< Server: nginx/1.10.2
< Date: Thu, 13 Sep 2018 20:16:22 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
< Accept-Ranges: bytes
< Vary: Accept-Charset, Accept-Encoding, Accept-Language, Accept
< X-Proxy-Cache: MISS
有人知道如何调试吗?