天天看点

nginx域名过长报错

买了一个8888888888888888888888888888888888888888888888888888888888888.com 的域名 算算61位加.com 一共是65位数

结果nginx 就直接报错

[root@sannian 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域名过长报错
[root@sannian 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
[root@sannian nginx]# nginx  -s reload
           

测试通过~1 OK! 访问一下看看~

nginx域名过长报错

继续阅读