配置nginx,遇到的几个小问题:

1、

报错信息:

# nginx -t

nginx: [warn] conflicting server name "test.hjq.com" on 0.0.0.0:, ignored

分析解决:

配置文件中,重复配置了server name : test.hjq.com 。

检查配置文件,去掉重复的,只保留唯一server name。

2、

报错信息:

# nginx -t 

nginx: [emerg] could not build the server_names_hash, you should increase either server_names_hash_max_size:  or server_names_hash_bucket_size: 64  

分析解决:

server_name  后配置了过多或过长的域名时,会报这个错。

官网有关这问题的说明:

If a large number of server names are defined, or unusually long server names are defined, tuning the server_names_hash_max_size and server_names_hash_bucket_size directives at the http level may become necessary.
The default value of the server_names_hash_bucket_size directive may be equal to 32, or 64, or another value, depending on CPU cache line size.
If the default value is 32 and server name is defined as “too.long.server.name.example.org” then nginx will fail to start and display the error message:
  could not build the server_names_hash,
  you should increase server_names_hash_bucket_size:
32
In this case, the directive value should be increased to the next power of two:
  http {
  server_names_hash_bucket_size
64;
  ...

If a large number of server names are defined, another error message will appear:
  could not build the server_names_hash,
  you should increase either server_names_hash_max_size:
512
  or server_names_hash_bucket_size: 32

In such a case, first try to set server_names_hash_max_size to a number close to the number of server names.
Only if this does not help, or if nginx’s start time is unacceptably long, try to increase server_names_hash_bucket_size.

官方解析:http://nginx.org/en/docs/http/server_names.html

最新文章

  1. jQuery Mobile 列表视图(带有自动检索)
  2. 《Wireshark数据包分析实战》 - http背后,tcp/ip抓包分析
  3. ML 05、分类、标注与回归
  4. Java开发 Eclipse使用技巧(转)
  5. QueryRunner的API
  6. 一周学会Mootools 1.4中文教程:(6)动画
  7. PHP中的for循环
  8. 认识jQuery的Promise
  9. Java项目之员工收录系统
  10. Java反射机制应用实践
  11. 基于opencv3.0下的运动车辆识别
  12. 雷林鹏分享:Laravel 安装
  13. 设计模式---接口隔离模式之代理模式(Proxy)
  14. 面试神体验之:get和post的区别
  15. CRC-16的原理和实现
  16. regular expression (如何用Sed和正则表达式提取子字符串)
  17. 什么是Unicode
  18. Web3.js API 中文文档
  19. 阿里云EC2+QEMU虚拟机+ROS完全教程!
  20. moco操作

热门文章

  1. (转载)Android引导界面实现
  2. 【转载】Reactor模式和NIO
  3. NOIp2018模拟赛三十二
  4. HDU-3416 Marriage Match IV 最短路+最大流 找各最短路的所有边
  5. [codevs3269]混合背包
  6. linux 下的小知识
  7. PHP设计模式(三)抽象工厂模式(Abstract Factory)
  8. Vue组件通信之Bus
  9. java 实现顺序结构线性列表
  10. FS,FT,DFT,DFS和DTFT的关系