0

I have a Joomla installed and need to allow users run one PHP file from /media folder. How to do it?

With current config, Nginx returnes this PHP as file for download, without executing it. Here is a part of my config:

location ~* /media {
   allow all;
   expires      1d;
}

location /media/dir/test.php {
   fastcgi_pass   unix:/var/run/php5-fpm.sock;
   include fastcgi_params;
   fastcgi_param       SCRIPT_FILENAME  $document_root$fastcgi_script_name;
}

location / {
   #PHP here works fine
   try_files $uri $uri/ /index.php?$args;
   # .. skipped ...
}
4

1 回答 1

1

我已经明白问题出在哪里了。我需要在文件中将“location ~* /media”块与“location /media/dir/test.php”块交换以获得正确的优先级。

于 2013-09-29T19:58:16.380 回答