K
K
Konstantin Khairov2019-08-29 12:54:31
Nginx
Konstantin Khairov, 2019-08-29 12:54:31

Why is proxy_cache not being migrated from proxy_temp_path??

Hello. I set up video caching on SSD by slice 1m, but the trouble is that nginx seems to start caching and new files appear in the temp folder, but these files are in the temporary folder and are not moved to the main cache folder and, accordingly, all requests go further to HDD disks which puts a lot of pressure on. How to persuade this Nginx to send everything to the right folder and give files from it and not from the HDD.
config

spoiler

server {
listen 80;
root /var/www/public_html/video/;
proxy_cache_path /var/www/public_html/video/ssd/cached inactive=1h levels=1:2 keys_zone=ssd_cache:50m max_size=50g;
proxy_temp_path /var/www/public_html/video/ssd/temp 1 2;
proxy_cache ssd_cache;
proxy_cache_valid 200 1h;
proxy_cache_lock on;
slice 1m;
proxy_cache_key $host$uri$is_args$args$slice_range;
proxy_set_header Range $slice_range;
proxy_http_version 1.1;
location / {
proxy_cache ssd_cache;
proxy_pass http://127.0.0.1:81;
proxy_cache_valid 200 1h;
proxy_cache_methods GET;
}
}

Temporary files appear in the /var/www/public_html/video/ssd/temp folder, but the cached folder is completely empty.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-08-29
@dodo512

Regarding proxy_cache_path and proxy_temp_path, the documentation says this:

Which of the directories will be used for temporary files is determined by the use_temp_path parameter (1.7.10). If the parameter is not set or set to “on”, then the directory specified by the proxy_temp_path directive for this location will be used. If the parameter is set to “off”, then temporary files will be located directly in the cache directory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question