NGINX and dynamic load balance using FQDN hosts

Started by gklipel, November 29, 2023, 07:23:36 PM

Previous topic - Next topic
Hi all!

Today I faced an issue with AWS load balancer and OPNSense as WAF and it was about using FQDN hostnames (or DNS hosts as you wish).
Cloudfront passes through OPNSense NGINX to reach app servers.

It turns out that I can't get the full potential of AWS load balancer and autoscaling since NGINX will work with static IPs resolved at daemons initialization, restarting or reloading.

I've found out that setting a dns resolver and using domain name (upstream server) in a variable may provide DNS refreshing interval as the user wishes ignoring DNS record TTL (can be seen in https://www.nginx.com/blog/dns-service-discovery-nginx-plus/ topic Setting the Domain Name in a Variable).

The question then is if would be possible to work in NGINX plugin to admit such autoscaling scenario? It would be extremely  useful to AWS users and containerization.

Thanks in advance!


December 07, 2023, 01:18:59 PM #2 Last Edit: December 07, 2023, 03:01:57 PM by Fright
Hi!
i think you can try (not with gui. with the hooks only) something like
https://tenzer.dk/nginx-with-dynamic-upstreams/