Does the expires directive add the head if the Expire head not exist?

Delta Yeh delta.yeh at gmail.com
Sun Aug 17 15:27:38 MSD 2008


I use

location / {
            proxy_redirect   off;
            proxy_redirect   default;

            #if ( $request_uri ~* ^.+.(css|jpg|jpeg|gif)$ ) {
            if ( $content_type ~* css ) {
               expires 1h;

            }

            proxy_pass http://my_upstream;

        }

but it does not work.

when I use $request_uri the browser get error response. It seems the nginx
box reset the tcp connection.
when I use $content_type  no Expires head returned by nginx.

2008/8/15 Igor Sysoev <is at rambler-co.ru>

> On Fri, Aug 15, 2008 at 05:42:06PM +0800, Delta Yeh wrote:
>
> > I want to use "expires" directive to  decrease the sever load.
> > My question is if there is no Expires head from the backend server , does
> > nginx add such head?
>
> nginx's expires overrides backend headers.
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080817/1d19281e/attachment.html>


More information about the nginx mailing list