代理缓存区静态未知

AnA*_*ice 4 nginx

我正在努力设置反向代理缓存。在 nginx.conf 中,我添加了以下内容:

location /blog {
        # Reverse Proxy
        # Cache the Blog Pages from Heroku
        proxy_cache                             STATIC;
        proxy_cache_valid               200     10m;
        proxy_cache_valid               404     1m;
        proxy_cache_use_stale   error timeout invalid_header updating http_500 http_502 http_503 http_504;

        rewrite ^/blog$             /;
        rewrite ^/blog/(.*)$    /$1;

        proxy_pass http://whispering-retreat-1.herokuapp.com;
        break;
}
Run Code Online (Sandbox Code Playgroud)

但是,当尝试重新启动 nginx 时,我收到以下错误:

$ /opt/nginx/sbin/nginx -s stop
nginx: [emerg] "proxy_cache" zone "STATIC" is unknown in /opt/nginx/conf/nginx.conf:182
Run Code Online (Sandbox Code Playgroud)

任何想法使用 STATIC 有什么问题?我只想缓存博客页面,这样它就不会每次都访问 heroku,这太慢了。

谢谢

VBa*_*art 5

“proxy_cache”区域“STATIC”未知

意味着您忘记配置它。 http://nginx.org/r/proxy_cache_path