# Custom HTTP Header

**URL:** <https://www.ruby-forum.com/t/custom-http-header/210159>\
**Category:** NGINX\
**Created:** [August 1, 2011, 3:49pm UTC](https://www.ruby-forum.com/t/custom-http-header/210159 "2011-08-01T15:49:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [August 1, 2011, 3:49pm UTC](https://www.ruby-forum.com/t/custom-http-header/210159/1 "2011-08-01T15:49:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![John\_Macleod](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a87d85/32.png) [@John\_Macleod](https://www.ruby-forum.com/u/John_Macleod)\
**Post date:** [August 1, 2011, 3:51pm UTC](https://www.ruby-forum.com/t/custom-http-header/210159/2 "2011-08-01T15:51:48Z")

</div>

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?

> **[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki...](https://github.com/nginxinc/nginx-wiki)**
>
> ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com

Maxim D.

---

<div class="post-metadata">

**Author:** ![John\_Macleod](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a87d85/32.png) [@John\_Macleod](https://www.ruby-forum.com/u/John_Macleod)\
**Post date:** [August 1, 2011, 4:04pm UTC](https://www.ruby-forum.com/t/custom-http-header/210159/3 "2011-08-01T16:04:49Z")

</div>

> [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/HttpHeadersModule#add_header)  
> .and then you can use the variables from  
> [GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com · GitHub](http://wiki.nginx.org/HttpUpstreamModule), e.g.

add\_header X-Backend $upstream\_addr;
