# Is this a bug?

**URL:** <https://www.ruby-forum.com/t/is-this-a-bug/217071>\
**Category:** NGINX\
**Created:** [February 21, 2012, 5:48am UTC](https://www.ruby-forum.com/t/is-this-a-bug/217071 "2012-02-21T05:48:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [February 21, 2012, 5:48am UTC](https://www.ruby-forum.com/t/is-this-a-bug/217071/1 "2012-02-21T05:48:03Z")

</div>

hello,everyone:  
I have the following questions about add\_header  
instruction.(version 1.1.8)

```
  This is my nginx.conf

        43 add_header Server ok;
        44 location / {
        45 add_header location ok;
        46 root html;
        47 index index.html index.htm;

  then construct a request

  [root@gitclubs conf]# curl -I http://localhost/
  HTTP/1.1 200 OK
  Server: nginx/1.0.12
  Date: Mon, 20 Feb 2012 08:13:02 GMT
  Content-Type: text/html
  Content-Length: 151
  Last-Modified: Mon, 13 Feb 2012 02:12:22 GMT
  Connection: keep-alive
  location: ok
  Accept-Ranges: bytes
  [root@gitclubs conf]#

  There is only location header.

  In ngx_http_headers_merge_conf() 

```

(ngx\_http\_headers\_filter\_module.c)  
440 if (conf-\>headers == NULL) {  
441 conf-\>headers = prev-\>headers;  
442 }

```
  If I config add_header in location and server, then prev->headers 

```

can’t be merged to conf-\>headers.  
Is this intended or a bug?  
Thanks.

ֻ15011367065

---

<div class="post-metadata">

**Author:** ![SSSSSS\_SSSSSS\_SSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/41988e/32.png) [@SSSSSS\_SSSSSS\_SSS](https://www.ruby-forum.com/u/SSSSSS_SSSSSS_SSS)\
**Post date:** [February 21, 2012, 9:58am UTC](https://www.ruby-forum.com/t/is-this-a-bug/217071/2 "2012-02-21T09:58:08Z")

</div>

Hello!

On Tue, Feb 21, 2012 at 12:47:37PM +0800, 马优生 wrote:

> ```
> location: ok
> If I config add_header in location and server, then prev->headers can't be 
> 
> ```

merged to conf-\>headers.

> ```
> Is this intended or a bug?
> 
> ```

This is intended. Array-type directives (all of them, not only  
add\_header) are inherited only if there are no corresponding  
directives defined at particular level.

Maxim D.
