nginx - unknown directive "state" in nginx 1.17.7
问题描述
I am trying to read the office doc of nginx.
There is the following in the upstream module.
Syntax: state file;
Default: —
Context: upstream
This directive appeared in version 1.9.7.
I tried to change the nginx.conf as following.
upstream loserver {
#server localhost:9002 max_fails=1 fail_timeout=1000s weight=2;
#server localhost:9001 max_fails=1 fail_timeout=1000s weight=100;
state /usr/local/nginx-1.17.1/conf/state_zwshao.conf;
}
And run the command to nginx -t
to test the configuration.
I got the following errors
unknown directive "state".
Anyone know the reason?
解决方案
推荐阅读
- regular-language - 为正则表达式构造 CFG
- react-native - 反应原生未处理的承诺拒绝 p0
- java - 当我尝试访问我的 wsdl 时,为什么会出现“日志已禁用”?
- java - 如何使用 junit/mockito for while 循环编写测试用例
- c# - Net Core:集成测试中的依赖注入
- c++ - C++ 可变参数函数语法
- python - 如何从 sklearn TfidfVectorizer 中删除所有非英语标记?
- azure - 无法从我的 Webapp 连接到我的 MYSQL Azure - 1045,“用户 'dbadmin'@'xx.xx.xx.x' 的访问被拒绝(使用密码:是)
- java - Jersey 2 - 在过滤器中注入请求范围的服务
- python - 如何识别列中的元素是整数还是字符串?