Custom HTTP Header

Is it possible to add a custom http header that identifies the nginx
server that handled the connection?

I have noticed a couple CDNs do this, on adds a CF1: xxXX:xxXX
location/node descriptor that shows with a curl -I

Or is there another way to do this?

Thanks!

John

Hello!

On Mon, Aug 01, 2011 at 03:48:13PM +0200, John Macleod wrote:

Is it possible to add a custom http header that identifies the
nginx server that handled the connection?

I have noticed a couple CDNs do this, on adds a CF1: xxXX:xxXX
location/node descriptor that shows with a curl -I

Or is there another way to do this?

http://wiki.nginx.org/HttpHeadersModule#add_header

Maxim D.

Module ngx_http_headers_module
.and then you can use the variables from
Module ngx_http_upstream_module, e.g.

add_header X-Backend $upstream_addr;