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

在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 问题解决。

 

转载于:https://www.cnblogs.com/matt18/p/5667569.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值