proxy_temp_path
Sets the path for temporary files used by the proxy module in NGINX. — NGINX HTTP Core
Описание
The `proxy_temp_path` directive specifies the directory in which temporary files are stored when NGINX is processing a proxy request. This directive is crucial for managing files that are created during the proxying of large responses or when the upstream server is slow. By default, the files are written to a path defined by this directive, helping to ensure that NGINX can efficiently handle the responses even if they exceed normal memory limits. The directive can take up to four arguments that define the directory path for storing temporary files, and additional options can specify how NGINX should manage these files. This is particularly important in high-traffic environments where memory usage may be a concern, as it allows NGINX to write large HTML responses or binary data without consuming undue amounts of memory. By setting `proxy_temp_path`, administrators can also closely control where temporary files are located, which can be relevant for managing disk space or complying with security policies. An important aspect of `proxy_temp_path` is that it must point to a writable directory; otherwise, NGINX may fail to process requests properly and return error messages. If NGINX is unable to create or write to the specified temporary directory, it may lead to issues with request handling and could affect overall performance.
Пример конфига
http {
proxy_temp_path /var/tmp/nginx/proxy;
}Ensure the directory is writable by the NGINX worker processes.
If the directory does not exist, NGINX will not create it automatically and may encounter errors.
Using a temporary path on a filesystem with poor performance can degrade proxy response times.