nginx报错-[emerg] unknown directive “echo_reset_timer“
报错 - nginx: [emerg] unknown directive “echo_reset_timer”
问题描述:
nginx: [emerg] unknown directive “echo_reset_timer” in /etc/nginx/conf/conf.d/pc.conf:86
nginx: configuration file /etc/nginx/conf/nginx.conf test failed
问题原因:
没有指定模块源码路径
解决方法:
[root@centos8 ~]# cd /usr/local/src
[root@centos8 src]# yum install git -y
[root@centos8 src]# git clone https://github.com/openresty/echo-nginx-module.git
[root@centos8 src]# cd nginx-1.18.0/
[root@centos8 src]# ./configure \
--prefix=/etc/nginx \
--user=nginx --group=nginx \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-pcre \
--with-stream \
--with-stream_ssl_module \
--with-stream_realip_module \
--with-http_perl_module \
--add-module=/usr/local/src/echo-nginx-module #指定模块源代码路径[root@centos8 src]# make && make install#确认语法检测通过
[root@centos8 ~]# /apps/nginx/sbin/nginx -t
nginx: the configuration file /apps/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /apps/nginx/conf/nginx.conf test is successful#重启nginx访问测试
[root@centos8 ~]# systemctl restart nginx
[root@centos8 ~]#nginx -V
nginx version: wanginx/1.68.9
built by gcc 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)
built with OpenSSL 1.1.1c FIPS 28 May 2019
TLS SNI support enabled
configure arguments: --prefix=/apps/nginx --user=nginx --group=nginx --withhttp_ssl_module --with-http_v2_module --with-http_realip_module --withhttp_stub_status_module --with-http_gzip_static_module --with-pcre --with-stream --with-stream_ssl_module --with-stream_realip_module --addmodule=/usr/local/src/echo-nginx-module