nginx 配置若干问题
配置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
nginx 配置若干问题的更多相关文章
- nginx配置入门
谢谢作者的分享精神,原文地址:http://www.nginx.cn/591.html nginx配置入门 之前的nginx配置是对nginx配置文件的具体含义进行讲解,不过对于nginx的新手可能一 ...
- nginx配置学习文章
partOne 自我释义部分 我的是阿里云的ubuntu *******实际上感觉这里是基本配置,很用不到*********#定义其用户或用户组user www-data;#nginx的进程数,应当为 ...
- nginx 配置入门
之前的nginx配置是对nginx配置文件的具体含义进行讲解,不过对于nginx的新手可能一头雾水. 今天看到个文档不错,翻译过来分享给大家,可以让新手更详细地了解nginx配置,可以说是nginx配 ...
- Nginx配置了解
安装Nginx常用编译选项说明 nginx大部分常用模块,编译时./configure --help查看,以--without开头的都是默认安装. --prefix=PATH 指定nginx的安装目录 ...
- 【nginx】nginx配置文件结构,内置变量及参数调优
Nginx的配置文件是一个纯文本文件,它一般位于Nginx安装目录的conf目录下,整个配置文件是以block的形式组织的.每个block一般以一个大括号“{”来表示.block 可以分为几个层次,整 ...
- Nginx配置杂记(转)
转至:http://www.cnblogs.com/kuangke/p/5619400.html Nginx是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP代理服务器,相较 ...
- 你需要知道的Nginx配置二三事
做服务端开发的,工作中难免会遇到处理Nginx配置相关问题.在配置Nginx时,我一直本着“照葫芦画瓢”的原则,复制已有的配置代码,自己修修改改然后完成配置需求,当有人问起Nginx相关问题时,其实仍 ...
- Nginx配置Https指南
前言 本文是对Nginx配置SSL证书的总结. 申请SSL证书 你可以从任何证书提供商处申请证书,这里以阿里云为例. 打开阿里云SSL证书控制台,点击购买证书 选择免费型一年期的证书,点击立即购买 注 ...
- nginx配置反向代理或跳转出现400问题处理记录
午休完上班后,同事说测试站点访问接口出现400 Bad Request Request Header Or Cookie Too Large提示,心想还好是测试服务器出现问题,影响不大,不过也赶紧上 ...
随机推荐
- mount ntfs 失败解决办法
在双系统中,ntfs可能会应为windows的缓存而挂载失败.可用下面命令修复. Use ntfsfix in the terminal, even if you can't access Windo ...
- 微信重排版 URL
http://qbview.url.cn/getResourceInfo?appid=62&url=https%3A%2F%2Fcodepen.io%2Fbenjamminf%2Ffull%2 ...
- ui5 load josn
sap.ui.jsview("ui5p.Test01", { /** Specifies the Controller belonging to this View. * In t ...
- ajax返回数据时,如何将javascript值(通常为对象或数组)转为json字符串
ajax获取值时,返回的数据为空时 alert后出现 [ ]; 用if语句判断时不为空,此时如何判断返回的数据是否为空.可将返回的值转化为json字符串. JSON.stringify() 方法用于将 ...
- SpringMVC简单介绍
1. 框架的作用 SpringMVC主要解决了控制器如何接收客户端的请求,并将处理结果响应给客户端的问题. 在传统的Java EE开发中,控制器是`Servlet`,主要存在的问题有: 1. 每个 ...
- 字符串格式时间转Date格式
/** * 字符串时间格式转 Date 格式 * @param strDate * @return */ public static Date getDateTimeByStringTime(Stri ...
- Promise语法
转自:廖雪峰的官方网站 在JavaScript的世界中,所有代码都是单线程执行的. 由于这个“缺陷”,导致JavaScript的所有网络操作,浏览器事件,都必须是异步执行.异步执行可以用回调函数实现: ...
- BZOJ 2555 SubString(LCT+后缀树)
喜闻乐见的LCT+SAM 此题要求动态插入,直接上后缀树.然后询问其实就是求一个节点的子树后缀结束节点的个数. 因为建立后缀树需要插入和删除,就直接上LCT.每次加入一个点,把它到根的路径加一 (现在 ...
- [USACO17DEC]Milk Measurement(平衡树)
题意 最初,农夫约翰的每头奶牛每天生产G加仑的牛奶 (1≤G≤109)(1≤G≤10^9)(1≤G≤109) .由于随着时间的推移,奶牛的产奶量可能会发生变化,农夫约翰决定定期对奶牛的产奶量进行测量, ...
- mybatis中 #跟$的区别
#相当于对数据 加上 双引号,$相当于直接显示数据 1. #将传入的数据都当成一个字符串,会对自动传入的数据加一个双引号.如:order by #user_id#,如果传入的值是111,那么解析成sq ...