Need To Run Multiple Location Blocks

justin nginx-forum at
Tue Jul 17 03:42:57 UTC 2012

I have the following location blocks:

  location ^~ /publish {

      #Allow home

      deny all;

Then the following location block to process PHP after:

    location ~\.php {
      try_files $uri =404;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_intercept_errors on;
      include /etc/nginx/fastcgi_params;

The problem is that a request to /publish/execute.php is only hitting
the first location block, and not hitting the fastcgi PHP execution
location block. How can I make the publish location block also check for
PHP files and if so, execute them according to the second location


Posted at Nginx Forum:,228624,228624#msg-228624

More information about the nginx mailing list