nginx: [emerg] could not build s

2020-04-10  本文已影响0人  小黑佬

问题

bash-4.4# nginx -t
nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 64
nginx: configuration file /etc/nginx/nginx.conf test failed

原因

由于域名太长,很可能发生这种情况。 您可以通过添加server_names_hash_bucket_size 128来解决此问题。

解决办法

我按照上面的错误处理server_names_hash_bucket_size 64是行不通。

改为server_names_hash_bucket_size 128后,可以通过。。

http {
  server_names_hash_bucket_size 128; #add by chunk

  server_tokens off;
  sendfile on;
  tcp_nopush on;
  tcp_nodelay on;
  keepalive_timeout 15;
  types_hash_max_size 2048;
  client_max_body_size 20M;
  include /etc/nginx/mime.types;
  default_type application/octet-stream;

  client_header_buffer_size 32k;
上一篇下一篇

猜你喜欢

热点阅读