在 X-WAF 部署中,需要新建一个 nginx 配置文件。但是在测试nginx配置的时候,发现报错,无法启动nginx。
我参考了http://blog.51cto.com/14071176/2318054,按照文章中的配置一步步做了,但是遇到了问题。
root@VM-0-6-ubuntu:~# /usr/local/openresty/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/openresty/nginx/conf/nginx.conf syntax is ok
nginx: [emerg] no "events" section in configuration
nginx: configuration file /usr/local/openresty/nginx/conf/nginx.conf test failed
root@VM-0-6-ubuntu:~# /usr/local/openresty/nginx/sbin/nginx
nginx: [emerg] no "events" section in configuration
一般情况下,执行/usr/local/openresty/nginx/sbin/nginx -t 会成功两次,而我的是成功和失败。