5 ms·
This issue has bitten me multiple times. You must set the resolver AND use the domain name in a variable. See here: https://www.nginx.com/blog/dns-service-disco
by cyounkins 5y ago
This issue has bitten me multiple times. You must set the resolver AND use the domain name in a variable. See here: https://www.nginx.com/blog/dns-service-discovery-nginx-plus/ https://www.nginx.com/blog/dns-service-discovery-nginx-plus/ under "Setting the Domain Name in a Variable". The other options ignore the record TTL or require Nginx Plus.
More details here: https://github.com/DmitryFillo/nginx-proxy-pitfalls https://github.com/DmitryFillo/nginx-proxy-pitfalls
- egberts1 5y agoNGINX Plus? That’s a thing? Sheesh. what a business model.
- nemothekid 5y agoThis x1000. This is why it always bites me; I know there's some magic incantation, but I always forget the one or the other; and you never notice until it causes downtime. The git repo is a huge help.
- mholt 5y agoHey, thanks for writing Caddy's advanced reverse proxy code years ago. I still used it as a model for Caddy 2's new reverse proxy.
- nemothekid 5y agoCaddy has come a long way since then! When my previous company switched to Caddy this issue was actually one of the motivating factors to adopting Caddy at the time (and I'm pretty sure Caddy 2 is in use today). I still mainly use Caddy over nginx (except where I'm running a no-frills debian system). This post actually means a lot because Caddy became so popular that (1) I assumed whatever I had written had been completely scrapped and forgotten and (2) no one would ever believe me that I made a big contribution "before Caddy was popular". It's one of the projects I'm so happy to see has come so far.
- mholt 5y agoHa, that's cool. Yeah, we still have the basic for loop that does upstream selection and load balancing, with the same timeout configs, etc. It's come a long way since then like you said, but I still consider Caddy 2's reverse proxy a derivative of your contribution from, like, week 3 of Caddy v1.