# Nginx 0.7.67 + Apache how to forbid responses with Set-Cookie being stored

**URL:** <https://www.ruby-forum.com/t/nginx-0-7-67-apache-how-to-forbid-responses-with-set-cookie-being-stored/214183>\
**Category:** NGINX\
**Created:** [November 24, 2011, 2:55am UTC](https://www.ruby-forum.com/t/nginx-0-7-67-apache-how-to-forbid-responses-with-set-cookie-being-stored/214183 "2011-11-24T02:55:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [November 24, 2011, 2:55am UTC](https://www.ruby-forum.com/t/nginx-0-7-67-apache-how-to-forbid-responses-with-set-cookie-being-stored/214183/1 "2011-11-24T02:55:18Z")

</div>

Hi,

I am caching apache with nginx. Application is developed by several  
people and consists of many modules.  
I would like to be sure that if by any case application sets Set-Cookie  
in the response and sets X-Accel-Expires \> 0 it would not get cached  
anyway.

Can i any how use proxy\_no\_cache with $upstream\_http\_ variables?  
Can I use apache mod\_headers to append or modify specific header only in  
case set-cookie occurs in the response?

It is easy by looking at the request headers, but have no luck finding  
solution for response headers.  
My general idea is to have 100% certainty that responses with Set-Cookie  
does not get cached.

0.7.67 is not negotiable as it is debian stable in production.  
Apache version 2.2.x

Thanks in advance, Tomasz Kraus  
Regards

Posted at Nginx Forum:

> **[Nginx 0.7.67 + Apache how to forbid responses with Set-Cookie being stored](https://forum.nginx.org/read.php?2,218910,218910#msg-218910)**
>
> Hi, I am caching apache with nginx. Application is developed by several people and consists of many modules. I would like to be sure that if by any case application sets Set-Cookie in the response and sets X-Accel-Expires \> 0 it would not get...
