Adding Hit/Miss header to proxied requests

Dave Barton dave.barton at comodo.com
Fri Aug 26 08:22:46 UTC 2011


Hi Maxim,

No idea how I missed that! Thanks for the help.

Cheers

Dave Barton
Senior Infrastructure Architect
Comodo CA Ltd

On 25/08/11 16:14, Maxim Dounin wrote:
> Hello!
> 
> On Thu, Aug 25, 2011 at 03:56:34PM +0100, Dave Barton wrote:
> 
>> Hi,
>>
>> We're using a pretty simple setup of ipvsadm balancing between 6 nginx
>> caching-proxies with 3 nginx backend servers configured.
>>
>> When the request hits the proxy, I add a header to show which proxy
>> serviced the request. Similarly the backend servers add a header to
>> their response to show which one served the traffic.
>>
>> Because we're anycasting the service at three locations, this
>> information is very useful for troubleshooting!
>>
>> Anyway, what I want to do now is add a header to show whether a response
>> was served from cache or from the backend. Having been through the
>> documentation I'm not currently able to see how this could be done.
>> Anyone able to offer any advice?
> 
> add_header X-Cached $upstream_cache_status;
> 
> http://wiki.nginx.org/HttpHeadersModule#add_header
> http://wiki.nginx.org/HttpUpstreamModule#.24upstream_cache_status
> 
> Maxim Dounin
> 
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5860 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20110826/70f5469f/attachment.bin>


More information about the nginx mailing list