1、编辑nginx.conf文件,添加了整计5个虚拟主机,如图1:
2、执行命令:nginx -s reload,重新加载,报错,如图2:
提示信息:nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 32
翻译:nginx:[emerg]无法构建server_names_hash,应该增加server_names_hash_bucket_size:32
3、打开网址:http://nginx.org/en/docs/http/server_names.html ,查看官网相应信息,如图3:
server_names_hash_bucket_size:服务器名称长度限制,因为其中一虚拟主机的名称为:www.yii2-starter-kit.test
4、编辑nginx.conf文件,将server_names_hash_bucket_size设置为64,如图4:
5、执行命令:nginx -s reload,重新加载,正常,如图5:
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/180445.html