No. In the other location blocks there are no add_header directives and the add_header directives are then inherited from the previous level.
The nginx documentation describes it quite well: „These directives are inherited from the previous level if and only if there are no add_header directives defined on the current level.“
That means it doesn’t get inherited for this block only because of the “cache-control” line, right?
So if I add headers I have to add them in both blocks, right?
PS: wouldn’t it be more comfortable to set all the headers in a separate file called “headers.conf” and load them with “include headers.conf” at the two locations in the nginx vHost configuration?
How does nginx handle this?
Will they be inserted in the correct place? That means in the exact place where I put the “include” line?
That is possible. It is up to you to decide whether this is more comfortable for you
Basically the line with the include-directive will be replaced with the contents of the included file. Thus the included file needs to have correct nginx configuration syntax.