📜 ⬆️ ⬇️

Cannot enable caching

Help is needed. Trying to configure caching using nginx. Config looks like this:

proxy_cache_path /tmp/nginx levels=1:2 keys_zone=CACHE:10m;

server {
listen 80;
....
location /maps/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;

proxy_cache CACHE;
proxy_cache_key "$host$request_uri $cookie_user";
proxy_cache_valid 200 302 10m;
proxy_cache_valid 301 1h;
proxy_cache_valid any 10m;
proxy_cache_min_uses 1;

proxy_pass backend:8081/maps/;
}
....
}


Cache directories are created, files appear in them, but requests still go to the backend (apache) as seen in the logs.
')
What am I doing wrong?

Source: https://habr.com/ru/post/62783/


All Articles