zhaofeng0019 / nginx-upstream-dynamic-resolve-servers Goto Github PK
View Code? Open in Web Editor NEWAn nginx module to resolve domain names inside upstreams and keep them up to date.
An nginx module to resolve domain names inside upstreams and keep them up to date.
Imagine this simple configuration:
upstream upstream {
server example.org resolve;
server example.com resolve;
server example.org resolve;
}
When just first upstream contains resolve param, everything works fine. But when multiple upstream servers has resolve param, nginx worker process fail with error in log like this:
socket() failed (97: Address family not supported by protocol) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "https://J?./", host: "localhost"
followed by worker crash. I will try to debug
Hi,
We're using dynamic_resolve directive from tengine, but are analyzing other options, since that directive resolves DNS in the request path and it should be better to have it asynchronously update, not blocking any request.
I have some questions regarding this module:
nginx的stream块下也有upstream的设置,能否对其进行适配呢
Hi,
Is there any limitation to use this module?
I have tested if there are a lot of domain name use "resolve", the server will return "(52) Empty reply from server" or "(35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to xxx" in many requests.
ngx_int_t ngx_http_upstream_dynamic_resolve_directive(
ngx_conf_t *cf, ngx_http_upstream_server_t *us, ngx_uint_t *i)
{
// ...
ngx_http_upstream_dynamic_resolve_server_conf_t *dynamic_server = NULL;
// ...
ngx_parse_url(cf->pool, &u);
if (!u.addrs || !u.addrs[0].sockaddr)
{
*// If it doesn't run here
dynamic_server = ngx_array_push(&udrsmcf->dynamic_servers);
if (dynamic_server == NULL)
{
return NGX_ERROR;
}
ngx_memzero(dynamic_server,
sizeof(ngx_http_upstream_dynamic_resolve_server_conf_t));
// ...
}
// ...
dynamic_server->use_last = 1; *// dynamic_server may be NULL
return NGX_AGAIN;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.