Given this nginx config:
http {
keepalive_timeout 65;
upstream nodejs {
server 127.0.0.1:8088;
}
server {
listen 8080;
location / {
proxy_pass http://nodejs;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
I understand that the http.keepalive_timeout defines the timeout to the client, while an http.upstream.keepalive_timeout would define the timeout to the upstream.
Does a keepalive_timeout value defined in http also implicitly set the upstream keepalive_timeout when it's not explicitly defined like in the example above, because upstream is part of http?
Finally found a chapter regarding inheritance in the docs. The answer is "yes", the child context inherits directives of the parent context:
In general, a child context – one contained within another context (its parent) – inherits the settings of directives included at the parent level. Some directives can appear in multiple contexts, in which case you can override the setting inherited from the parent by including the directive in the child context.