Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NGINX_PROXY_PASS_URL use long cache DNS resolution #333

Closed
FrancYescO opened this issue Aug 31, 2023 · 5 comments
Closed

NGINX_PROXY_PASS_URL use long cache DNS resolution #333

FrancYescO opened this issue Aug 31, 2023 · 5 comments
Labels

Comments

@FrancYescO
Copy link

i was using
NGINX_PROXY_PASS_URL=http://registry:5000
and another container on the same stack with the "registry" name, all is working good until the registry container get update/restarted and changes IP... seems the ui will take a pretty infinite cache of the old DNS resolution of the registry name causing, when accessing the UI

[error] 176#176: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 10.171.3.6, server: localhost, request: "GET /v2/_catalog?n=1000 HTTP/1.1", upstream: "http://10.171.3.5:5000/v2/_catalog?n=1000"

just restarting the UI container fixes the issue

i've also tested ping registry from container shell before restarting and the IP of registry container was the correct one

here some more detail on the issue that seems pretty related to nginx
https://serverfault.com/questions/240476/how-to-force-nginx-to-resolve-dns-of-a-dynamic-hostname-everytime-when-doing-p

@Joxit Joxit added the bug label Sep 10, 2023
@Joxit
Copy link
Owner

Joxit commented Sep 10, 2023

Hi, thank you for using my project an submitting issue. You're totally right, this is a common issue where nginx is saving the IP after a DNS query and will not update it.

@Joxit Joxit closed this as completed in 1f29132 Oct 2, 2023
@Joxit
Copy link
Owner

Joxit commented Oct 2, 2023

Sorry for the late release, should be available in 2.5.3

@Joxit
Copy link
Owner

Joxit commented Oct 17, 2023

Hi there
Due to a regression caused by this fix and affecting kubernetes users, in the next release 2.5.5 you will need to use the option NGINX_RESOLVER set to 127.0.0.11 to have the same effect

@FrancYescO
Copy link
Author

FrancYescO commented Oct 17, 2023

hello, what if during bootstrap make a stub request to 127.0.0.11 and if get replied automatically set NGINX_RESOLVER? this to avoid the need to have this to be manually set

@Joxit
Copy link
Owner

Joxit commented Oct 17, 2023

This needs dig to be installed and will make the bundle heavier since it's not by default...
But this is also useful when your resolver is outside the docker network. That's why I chose this option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants