DNS Resolving for redirectionio_pass
derdiggn opened this issue · 2 comments
Is there any way to call the NGINX DNS Resolver on any Request like proxy_pass does this.
see https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass for more information
Parameter value can contain variables. In this case, if an address is specified as a domain name, the name is searched among the described server groups, and, if not found, is determined using a resolver.
In our case the IP address of the redirectionio agent can change so we plan to resolve the hostname every n seconds (as we already do with the other upstream servers)
Example based on proxy_pass configuration
server {
...
set $backend_express express.domain.tld;
location @expressjs-backend {
proxy_pass http://$backend_express:4000;
}
...
}
actually this is not working with redirectionio_pass
server {
...
set $backend_redirectionio redirectionio.domain.tld;
redirectionio_pass $backend_redirectionio:10301;
...
}
Hey there,
Our system use the nginx DNS resolver for redirectionio_pass (so you can change the ip and it will resolve),
However the examples your provide refer to the variable system of nginx which is not supported for the redirectionio_pass configuration.
How do you plan to update the ip ?
Also please note that the connection to the agent is persisted across requests and use a pool for better performance, this will indue a "lag" / errors reports when the ip of the agent is updated through dns before it use the new (old connections would be invalid and throw an error until all connections are reset). In this case you can configure the pool to not keep any connection: redirectionio_pass 127.0.0.1:10301 min_conns=0 keep_conns=0 max_conns=100 timeout=100
Hi,
after a lot of testing we found a problem in our Docker Environment.
Thanks for your support.