nginx as load balancer + apache as a web server issue

Ryan Malayter malayter at
Thu Aug 12 01:48:06 MSD 2010

On Tue, Aug 10, 2010 at 8:17 PM, josesan311 <nginx-forum at> wrote:
> Hey guys,
> I have just found and fixed the issue, it was related to the following
> settings, commenting them solved the ie8 issue,
> #  client_body_timeout   60;
> #  client_header_timeout 60;
> #  expires               24h;
> #  keepalive_timeout     60 60;
> #  send_timeout          60;
> Any advice why this would happen?

The "expires 24h" is probably telling nginx to add a cache-control
header to everything in that location. So the browser was caching the
old page that didn't have the item removed from the cart, and showing
that. (I am assuming your "expires" was set at a high level in nginx
configuration, maybe at the server level?)

Typically, in most applications, dynamic pages should expire
immediately, and static items (images, CSS, JS, etc.) should have
longer expiration times sent to the browser. (There are exceptions, of
course... think of an RSS feed. You might want it to be cached for 15
minutes, even though it is a dymic page.)

You can make separate locations in nginx to fix this (one for statics,
the other for dynamics). Use a regex-based location if all the dynamic
stuff isn't under one path.


More information about the nginx mailing list