proxy_pass and weird behaviour

Maxim Dounin mdounin at mdounin.ru
Mon Mar 13 12:44:31 UTC 2017


Hello!

On Sat, Mar 11, 2017 at 09:07:54AM +0100, Michael Grimm wrote:

[...]

> Well, that is working, somehow, except: If the LE server 
> addresses Host A, the challenge file is going to be retrieved 
> instantaneously. If the LE server addresses Host B, only every 
> *other* request is being served instantaneously:
> 
> 	1. access: immediately download
> 	2. access: 60 s wait, then download
> 	3. access: immediately download
> 	4. access: 60 s wait, then download
> 	etc.
> 
> 
> Hmm, default proxy_connect_timeout is 60s, I know. But why every 
> other connect?

You are using "proxy_pass http://local-at-host-A.lan;" in your 
configuration.  What are the IP addresses it resolves to?

The behaviour observed suggests that the name resolves to 2 
different addresses, so nginx uses round-robin to balance between 
these addresses, and only one of these addresses is reacheable.

The exact pattern also requires more than 10 seconds between (2) 
and (4), else (4) will be directed to a properly working address, 
see http://nginx.org/en/docs/http/ngx_http_upstream_module.html#fail_timeout.  
Though it is something likely to happen when testing manually.

-- 
Maxim Dounin
http://nginx.org/


More information about the nginx mailing list