Welcome! Log In Create A New Profile

Advanced

A bug about add_header instruction....

Posted by gitclubs 
A bug about add_header instruction....
February 20, 2012 04:02AM
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]# curl -I http://localhost/

There is only location header.

In 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.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 326
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready