Different cache time for different locations

António P. P. Almeida appa at perusio.net
Fri Sep 21 16:44:32 UTC 2012

On 21 Set 2012 15h40 CEST, nfnlists at gmail.com wrote:

> Hello,
> That's the way applications like wordpress and others works, in my
> case it's Invision Power Board.

With WP you can enumerate all PHP files and even if you don't want to
do that you can constrain the execution by using something like this:

        ## Regular PHP processing.
        location ~ ^(?<script>.+\.php)(?<path_info>.*)$ {
            include fastcgi.conf;
            ## The fastcgi_params must be redefined from the ones
            ## given in fastcgi.conf. No longer standard names
            ## but arbitrary: named patterns in regex.
            fastcgi_param SCRIPT_FILENAME $document_root$script;
            fastcgi_param SCRIPT_NAME $script;
            fastcgi_param PATH_INFO $path_info;
            ## Passing the request upstream to the FastCGI
            ## listener.
            fastcgi_pass phpcgi;

--- appa

More information about the nginx mailing list