[PATCH 1 of 2] HTTP: add support for trailers in HTTP responses

Piotr Sikora piotrsikora at google.com
Tue Jun 28 01:43:46 UTC 2016

Hey Shuxin,

> How do you manage to tackle this scenario without changing your existing
> code:
>     backend server responses with trailer "lol = 123", and you define the
> same trailer,
> "lol = $haha" in *.conf. You have two options as to how to combine them:
> either override the
> one from origin, and override the one from your *.conf.

...or the third option - emit both trailers ;)

This is consistent with how duplicate headers are currently handled in
NGINX, that is: headers emitted by upstream and those added with
"add_header" are both transmitted to the client.

> It seems to me that the
> chunk-module is again a best place for such change.

Again, chunked module is HTTP/1.1 specific and nothing other than
"encode trailers from r->headers_out.trailers to HTTP/1.1" should be
handled there.

Best regards,
Piotr Sikora

More information about the nginx-devel mailing list