Welcome! Log In Create A New Profile

Advanced

proxy_pass to dyndns address

Posted by basti 
basti
proxy_pass to dyndns address
July 26, 2018 08:50PM
Hello,

inside a location I have a proxy_pass to a hostname with a dynamic IP
for example

location ^~ /example/ {
proxy_pass https://host1.dyndns.example.com;
}

getent hosts resolve the right IP.
But in via nginx return a 504.

When I reload nginx it work until IP is changed.
The DNS Server for this is on the same host.
TTL is only 300s.

I have found the resolver directive, I'm not sure if this is the right
one because of the small TTL.
Is there a way to get this working?

Best Regards
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Richard Stanway
Re: proxy_pass to dyndns address
July 30, 2018 06:10PM
nginx only resolves hostname once on startup. See this workaround:

https://github.com/DmitryFillo/nginx-proxy-pitfalls

On Thu, Jul 26, 2018 at 8:47 PM basti <[email protected]> wrote:

> Hello,
>
> inside a location I have a proxy_pass to a hostname with a dynamic IP
> for example
>
> location ^~ /example/ {
> proxy_pass https://host1.dyndns.example.com;
> }
>
> getent hosts resolve the right IP.
> But in via nginx return a 504.
>
> When I reload nginx it work until IP is changed.
> The DNS Server for this is on the same host.
> TTL is only 300s.
>
> I have found the resolver directive, I'm not sure if this is the right
> one because of the small TTL.
> Is there a way to get this working?
>
> Best Regards
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
basti
Re: proxy_pass to dyndns address
July 30, 2018 07:00PM
Thanks a lot.

On 30.07.2018 18:02, Richard Stanway wrote:
> nginx only resolves hostname once on startup. See this workaround:
>
> https://github.com/DmitryFillo/nginx-proxy-pitfalls
>
> On Thu, Jul 26, 2018 at 8:47 PM basti <[email protected]
> <mailto:[email protected]>> wrote:
>
> Hello,
>
> inside a location I have a proxy_pass to a hostname with a dynamic IP
> for example
>
> location ^~ /example/ {
>         proxy_pass https://host1.dyndns.example.com;
> }
>
> getent hosts resolve the right IP.
> But in via nginx return a 504.
>
> When I reload nginx it work until IP is changed.
> The DNS Server for this is on the same host.
> TTL is only 300s.
>
> I have found the resolver directive, I'm not sure if this is the right
> one because of the small TTL.
> Is there a way to get this working?
>
> Best Regards
> _______________________________________________
> nginx mailing list
> nginx@nginx.org <mailto:[email protected]>
> http://mailman.nginx.org/mailman/listinfo/nginx
>
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Sorry, only registered users may post in this forum.

Click here to login