大网数据广告活动
服务器运维问答

nginx - could not build optimal variables_hash

· 52CE 我爱测

For quite some time now nginx gives me this warning: nginx: [warn] could not build optimal variables_hash, you should increase either variables_hash_max_size: 1024 or variables_hash_bucket_size: 64; ignoring variables_hash_bucket…

问题原文

原帖链接 · BrainStone · CC BY-SA 3.0

For quite some time now nginx gives me this warning:

nginx: [warn] could not build optimal variables_hash, you should increase either variables_hash_max_size: 1024 or variables_hash_bucket_size: 64; ignoring variables_hash_bucket_size

However in the http block of my config I have this:

http {
  # More config...

  variables_hash_max_size 1024;
  variables_hash_bucket_size 64;

  # More config...
}

(Increasing to higher values doesn't solve it either! Also I ran nginx -T and checked if these keys were set to a different value, which they were not!)
How do I solve this?

(If required I will post more of the config. I'm just not sure which parts are relevant.)

已采纳解答

原帖链接 · Ulfy · CC BY-SA 3.0

You mentioned...

and checked if these keys were set to a different value, which they were not!

Was that just spot-checking that declarative, or did you grep the config files? I would do the latter to ensure it isn't declared somewhere else as well.

Paste the results of nginx -V.

Do you have any extra modules enabled? How high a value did you try? It's possible that you either have modules adding to the variable weight or you have a lot (or lengthy values) declared.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-07-03)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。