question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resolver directive not working?

See original GitHub issue

Checklist

What is troubling you?

I’m using proxy manager to proxy docker containers but when a container is restarted the proxy manager reports a 502 BAD GATEWAY. I tried adding the resolver directive in the advanced configuration, like resolver 127.0.0.11 ipv6=off valid=30s; but it doesn’t seem to work: image

Do I need to use a variable for the resolve to work properly?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
chaptergycommented, May 12, 2021

I’m pretty sure he means like this:

location / {
    resolver 127.0.0.11 valid=30s;
    set $custom_upstream example.com;
    proxy_pass http://$custom_upstream:80;
}

The $custom_upstream is the variable which will prevent DNS resolution at startup.

Which you can paste into your advanced tab.

1reaction
rlogiaccocommented, Oct 27, 2020

I managed to have it working and it also solves #633 : you must use a variable and the resolver directive. The variable prevents the DNS resolution at boot from nginx, the resolver determines how frequently such variable is checked against the internal docket DNS.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolver directive not working? · Issue #669
I'm using proxy manager to proxy docker containers but when a container is restarted the proxy manager reports a 502 BAD GATEWAY. I...
Read more >
nginx set directive not working
I'm facing the same issue as described in How to force nginx to resolve DNS (of a dynamic hostname) everytime when doing proxy_pass?...
Read more >
nginx proxy_pass resolver not working - reverse proxy
I have setup a nginx (1.9.5) as a proxy for few tomcat servers. I am pointing to these servers through a route53 domain...
Read more >
resolver directive takes only hardcoded IP?
I can hardcode an IP with the resolver directive and it works ok. Am I trying to do something that's an unsupported use...
Read more >
Resolver not working as expected
DNS servers defined > by the "resolver" directive are only used for dynamic / run-time > name resolution - for example, when variables...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found