在增加了一个虚拟主机后,执行nginx -t测试报错:
could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
于是我就在http区加上了
server_names_hash_bucket_size 64;
注意:这里的只要设置32的倍数即可,不需要很大,太大的话 是用 nginx -s stop 命令停止会相对较慢, 这个参数适合就好!
http {
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 64;