欢迎您访问我爱IT技术网,今天小编为你分享的电脑教程是服务器系列之:【Nginx could not build the server_names_hash 错误的解决办法】,下面是详细的分享!
Nginx could not build the server_names_hash 错误的解决办法
如果定义了大量名字,或者定义了非常长的名字,那可能需要在http配置块中使用server_names_hash_max_size和server_names_hash_bucket_size指令进行调整。server_names_hash_bucket_size的默认值可能是32,或者是64,或者是其他值,取决于CPU的缓存行的长度。如果这个值是32,那么定义“too.long.server.name.example.org”作为虚拟主机名就会失败,而nginx显示下面错误信息:could not build the server_names_hash,
you should increase server_names_hash_bucket_size: 32
出现了这种情况,那就需要将指令的值扩大一倍:
http {
server_names_hash_bucket_size 64;
...
如果定义了大量名字,得到了另外一个错误:
could not build the server_names_hash,
you should increase either server_names_hash_max_size: 512
or server_names_hash_bucket_size: 32
那么应该先尝试设置server_names_hash_max_size的值差不多等于名字列表的名字总量。如果还不能解决问题,或者服务器启动非常缓慢,再尝试提高server_names_hash_bucket_size的值。
以上就是关于Nginx could not build the server_names_hash 错误的解决办法的服务器维护教程分享,更多电脑教程请移步到>>电脑教程频道。
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
