-
Notifications
You must be signed in to change notification settings - Fork 430
Fixes #44. Respect DNS TTL for proxies. #63
Conversation
https://tenzer.dk/nginx-with-dynamic-upstreams/ Nginx currently does not resolve domains passed to `proxy_pass`. By using a variable it works around the issue. This also fixes a bug where fallback proxy match would just match the first proxy vs the longest.
Amazing, thanks @hone. Going to give this a try now. |
I just verified (using this branch) that the proxy config now honors DNS TTL. Using a CNAME with a 60-second TTL, I confirmed that whenever the CNAME's target is changed, then the proxy re-resolves to the new target within 60-seconds. Awesome work @hone 🎯 |
BTW, I also confirmed that this behavior is broken on master, requiring a restart to re-resolve to the new CNAME target. |
Our app fails "reliably" everyday during dyno restarts between the client and the server app. Will let you know if the branch fixes it. On a sidenote, is there intention to expose the ability to customize the resolver via config? I see you are already joining multiple resolvers if they exist in |
@daemonsy thanks, definitely interested to hear if it works for you. Yeah, every dyno should have |
Its mostly just to have more than 1 resolver for fallback. All our apps are on Heroku, so that part about using |
@daemonsy gotcha. would you be ok with this as is then or would you still want a section in |
I think we'll never use the buildpack outside a Heroku environment, so abstracting away the DNS resolution is actually a nice thing for us. Based on our other discussion, I feel that this exposes too much of NGINX in Might be useful for advanced cases if it was exposed as some advanced settings section or an |
@daemonsy I'd still like to resolve that for you, but it's a real problem and the buildpack should support that use case. |
@hone the branch has been working beautifully for us in the last two days. No more failed proxy requests 👍 |
Sorry let me play the nag for this. If everyone involved is having no problems with the buildpack (we had it in production for 4 days) and @hone has no reservations, this can be merged? |
Thanks for nagging :) It hasn't been merged b/c I was waiting for other
feedback and been at Devoxx US (mostly away from a computer this week).
I'd be happy to merge with just the feedback I have now when I get on a
computer. This is a big gaping hole and makes proxying unusable in
production.
…On 24/03/17 12:11, Damon Aw wrote:
Sorry let me play the nag for this. If everyone involved is having no
problems with the buildpack (we had it in production for 4 days) and
@hone <https://github.com/hone> has no reservations, this can be merged?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#63 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABASQFW2i_eYWTbdyaUEFJsKTm6nGIfks5ro_kwgaJpZM4MhUQ1>.
|
Thanks! No rush at all if you're still waiting for feedback. Just checking in to make sure it doesn't slide off our radars by accident. |
@hone thanks for the merge! 🙏 Can someone help me understand if buildpacks that are built on top of heroku-buildpack-static will automatically pick this change up on the master branch? |
Revised to avoid misinformation: @hone will cut a new release. |
Fantastic 👌 |
@wcurtis I'll need to cut a new release of the static buildpack before it gets picked up. I'll take a look at doing that in the next day. |
@hone any update on cutting that new release? |
If you set the buildpack to Make sure to switch back to |
@mars make sense. My understanding is since I'm using an Ember buildpack that uses this one as a dependency it will require a version bump to pick this fix up. |
I don't pull off of master for stability reasons on the ember buildpack.
I've pushed up a new release of the static buildpack, let me know if you
don't see the changes.
…On 30/03/17 11:25, Bill Curtis wrote:
@mars <https://github.com/mars> make sense. My understanding is since
I'm using an Ember buildpack
<https://github.com/heroku/heroku-buildpack-emberjs#architecture> that
uses this one as a dependency it will require a version bump to pick
this fix up.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#63 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABASRTwhxLIZnecxHn9EoNLUkEiRVZ0ks5rq_OLgaJpZM4MhUQ1>.
|
Fixes #44
https://tenzer.dk/nginx-with-dynamic-upstreams/
Nginx currently does not resolve domains passed to
proxy_pass
. By using a variable it works around the issue. The resolver is set to what's in/etc/resolv.conf
and failing that8.8.8.8
which is a Google DNS.This also fixes a bug where fallback proxy match would just match the first proxy vs the longest.