码迷,mamicode.com
首页 > 其他好文 > 详细

nginx 报错 nginx: [emerg] could not build the variables_hash,

时间:2016-07-13 20:29:12      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:

在nginx重启的时候报错了:

nginx: [emerg] could not build the variables_hash, you should increase either variables_hash_max_size: 512 or variables_hash_bucket_size: 64

 

此时按照网上的修改 以下这些内容,根本没用!

types_hash_max_size 2048;
   server_names_hash_bucket_size 128;

还是别改这些内容了,  

看提示,很明显是variables_hash_max_size或者variables_hash_bucket_size的大小问题,

查看资料发现:  

      variables_hash_bucket_size

      语法:variables_hash_bucket_size size
      默认值:variables_hash_bucket_size 64
      使用字段:http
      变量:无
      为变量哈希表指定关键字栏大小。

      variables_hash_max_size

      语法:variables_hash_max_size size
      默认值:variables_hash_max_size 512
      使用字段:http
      变量:无
      哈希表的最大值,查看更多信息请参考nginx部分优化选项中的哈希表。

因此设置了默认值的大小(和报错提示设置值相同),(他们的设置在nginx.conf文件中的 http{} 内部)

结果还是不行,

最后将二者的值设置为一个更大的值,(他们的设置在nginx.conf文件中的 http{} 内部)

variables_hash_max_size 4096

variables_hash_bucket_size 2048

擦,奇迹出现,命令行输入  nginx -t  后看不到之前的错误了,重启nginx, ok 问题解决。

 

nginx 报错 nginx: [emerg] could not build the variables_hash,

标签:

原文地址:http://www.cnblogs.com/matt18/p/5667569.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!