<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Helvetica, Arial, sans-serif">I think there's just a simple
typo in your regex. Try, <br>
</font>
<pre wrap="">location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$</pre>
I've been using the expires 30d; and I think it works ok.<br>
Chris :)<br>
<br>
David wrote:
<blockquote cite="mid:loom.20080906T155101-412@post.gmane.org"
 type="cite">
  <pre wrap="">Hi,

Expires .. is there a way to set an expires header for all of jpg, gif, css, js ?

I have been reading through the docs and have tried a few things such as:

        location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html)$ {
            access_log        off;
            expires           30d;
        }

This made me think what I am asking must be possible, but the above makes every
page on my site 404.

            location ~* ^.+\.(jpg|jpeg|gif)$ {
                root         /spool/www;
                access_log   off;
                expires      30d;
            }

This would work, but I don't have a fixed root for images. I'd like to do it
throughout an entire site - or would I simply change the root in the above
example to my document root ?

Thanks



  </pre>
</blockquote>
</body>
</html>