美文网首页
nginx: [emerg] could not build s

nginx: [emerg] could not build s

作者: 小黑佬 | 来源:发表于2020-04-10 14:44 被阅读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;
    

    相关文章

      网友评论

          本文标题:nginx: [emerg] could not build s

          本文链接:https://www.haomeiwen.com/subject/gdermhtx.html