nginx域名过长报错

买了一个8888888888888888888888888888888888888888888888888888888888888.com 的域名 算算61位加.com 一共是65位数
结果nginx 就直接报错

[[email protected] conf.d]# nginx  -t
nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 64
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed

百度了一下说是加个这个

在配置文件的http{}段增加一行配置

server_names_hash_bucket_size 512;

然后打开nginx.conf添加
nginx域名过长报错

[[email protected] nginx]# nginx  -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[[email protected] nginx]# nginx  -s reload

测试通过~1 OK! 访问一下看看~
nginx域名过长报错