We’re running Moodle which uses this format to load images:
/file.php/dirname/file.gif
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 127.0.0.1:9000
location ~ ^(?<SCRIPT_FILENAME>.+\.php)(?<PATH_INFO>.*)$ {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
}