[root@centos7 /usr/local/nginx/sbin]# ./nginx -V
Tengine version: Tengine/2.3.3
nginx version: nginx/1.18.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-stream --add-module=modules/ngx_http_upstream_dynamic_module --add-module=modules/ngx_http_upstream_vnswrr_module
upstream tcp_servers_3306 {
dynamic_resolve fallback=stale fail_timeout=30s;
server m1.qingsuan-bvt-base01.bus:3306;
}
server {
error_log /usr/local/nginx/logs/3306_error.log;
access_log /usr/local/nginx/logs/3306_access.log proxy;
listen 3306;
proxy_connect_timeout 5s;
proxy_timeout 20s;
proxy_pass tcp_servers_3306;
}
2条答案
按热度按时间tf7tbtn21#
[root@centos7 /usr/local/nginx/sbin]# ./nginx
nginx: [emerg] "dynamic_resolve" directive is not allowed here in /usr/local/nginx/conf/extra/tcp_3306.conf:2
vmpqdwk32#
[root@centos7 /usr/local/nginx/sbin]# ./nginx nginx: [emerg] "dynamic_resolve" directive is not allowed here in /usr/local/nginx/conf/extra/tcp_3306.conf:2
@tencentminghuang Now, the
ngx_http_upstream_dynamic_module
is only supports context ofhttp
block.