Expires max question

Ilan Berkner ilan at time4learning.com
Thu Dec 29 16:06:52 UTC 2011

We're running Moodle which uses this format to load images:


Using the map directives and modification of fastcgi parameters and
location tag I was able to get the above format working.

I would now like to associate the "expires max" option with any media files
such as swf, gif, jpg, etc. but this type of location tag (rightfully so)
interferes with the php location tag (normally it wouldn't as I'd strictly
be dealing with .php$).  These are the 2 location tags I'm trying to
combine or make work together, does anyone have any suggestions?

    # This location tag interferes with the PHP location tag (for calls
such as file.php/dir/file.jpg)
    #location ~* \.(js|css|png|jpg|jpeg|gif|ico|flv|swf)$ {
    #  expires max;
    #  log_not_found off;

    # pass the PHP scripts to FastCGI server listening on
    location ~ ^(?<SCRIPT_FILENAME>.+\.php)(?<PATH_INFO>.*)$ {
        include         fastcgi_params;
        fastcgi_index   index.php;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20111229/674750af/attachment.html>

More information about the nginx mailing list