天天看點

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域名過長報錯

繼續閱讀