I'm following this sample configuration from the Nginx docx. Reverse-proxying works fine except that it isn't caching results.
Here is my nginx.conf:
user http http;
worker_processes 1;
events {
worker_connections 1024;
}
http {
proxy_cache_path /srv/http/my.site/cache levels=1:2 keys_zone=STATIC:10m inactive=24h max_size=1000m;
proxy_temp_path /srv/http/my.site/tmp;
server {
listen 8081;
server_name my.site remote.host;
location / {
proxy_pass http://remote.host;
proxy_cache STATIC;
proxy_cache_valid 200 302 1d;
proxy_cache_valid 404 1m;
}
}
}
Folder permissions are OK as far as I can tell:
ls -l /srv/http/my.site/
total 8
drwxr-xr-x 2 http http 4096 Dec 21 04:24 cache
drwxr-xr-x 2 http http 4096 Dec 21 04:24 tmp