解决办法
将配置文件的 http 的 proxy_cache_path 由500改为300
proxy_cache_path /usr/local/nginx/proxy_cache_path levels=1:2 keys_zone=cache_one: 300m inactive=1d max_size=10g;
proxy_temp_path /usr/local/nginx/proxy_temp_path;
测试
ubuntu@VM-0-13-ubuntu:/etc/nginx$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
重启即可
sudo nginx -s reload
本文介绍如何通过修改Nginx配置文件中的代理缓存路径参数,将proxy_cache_path的缓存级别由500调整为300,以优化缓存策略。调整后的配置包括缓存级别、缓存区大小、最小活动时间和最大缓存大小。经过测试,配置文件语法正确且测试成功,最后通过重启Nginx服务使更改生效。
1229

被折叠的 条评论
为什么被折叠?



