Nginx could not build the server_names_hash 错误的解决办法
2014-03-16 16:33
836 查看
在给nginx 配置了一个超长的域名后,通过 /usr/local/nginx/sbin/ngnix -t 检查配置文件时出现一下错误:
解决办法是在nginx的配置文件的http段中增加如下配置:
复制代码 代码如下: server_names_hash_bucket_size 64;
如果已经存在,需要加大后面的数值,注意:该数值是32的倍数为宜。
下面是nginx官方文档:
复制代码 代码如下: 如果定义了大量名字,或者定义了非常长的名字,那可能需要在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 错误的解决办法
- Nginx:nginx could not build the server_names_hash解决办法
- Nginx: could not build the server_names_hash 解决办法
- Nginx: could not build the server_names_hash 解决办法
- Nginx出现could not build the server_names_hash 解决办法
- nginx could not build the server_names_hash 解决方法
- nginx “nginx could not build the server_names_hash”解决方法
- nginx配置出错 could not build the server_names_hash, you should increase either server_names_hash_max_si
- nginx报could not build theproxy_headers_hash错误,无法启动
- nginx could not build the server_names_hash错误
- vc++ "Error spawning 'vcspawn.exe'. The build could not be performed" 错误解决办法 (测试通过)
- nginx报错”could not build the server_names_hash”
- nginx问题之nginx: could not build server_names_hash, you should increase server_names_hash_bucket_size解决方案
- tomcat出现Could not load the Tomcat server configuration at 。。异常解决办法
- Eclipse 报 "The builder launch configuration could not be found" 错误的解决办法
- Eclipse 报 "The builder launch configuration could not be found" 错误的解决办法
- Nginx做负载均衡报:nginx: [emerg] could not build the types_hash
- Server Application Unavailable 【Failed to execute request because the App-Domain could not be created.】的解决办法
- Eclipse 报 "The builder launch configuration could not be found" 错误的解决办法
- The message received from the server could not be parsed 错误解决方法