当前位置: 代码迷 >> 综合 >> nginx 软重启报错 mmap(MAP_ANON|MAP_SHARED, 524288000) failed (12: Cannot allocate memory)
  详细解决方案

nginx 软重启报错 mmap(MAP_ANON|MAP_SHARED, 524288000) failed (12: Cannot allocate memory)

热度:40   发布时间:2023-12-22 10:00:04.0
解决办法

将配置文件的 httpproxy_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
  相关解决方案