From the add_header docs I understand that it works at location, http
and
server context. But when I use add_header at the server level I don’t
see
the headers being added to the response.
For example my server config starts with:
server {
listen 9088;
server_name localhost;
tcp_nodelay on;
On Mon, Sep 30, 2013 at 03:42:50PM +0200, Thijs K. wrote:
Hi there,
From the add_header docs I understand that it works at location, http and
server context. But when I use add_header at the server level I don’t see
the headers being added to the response.
Am I missing something or is this just not working at the server level for
some reason?
You’re missing something.
You’re either missing that if the second argument to add_header expands
to empty, then the header is not added; or that configuration directive
inheritance is by replacement, not addition.
Thanks. So using add_header in the location scope omits any earlier
add_header statements used in the parent scope. I am surprised that it
works like that, but it’s definitely good to know.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.