PHP not working in regex locations (?)

Jonathan Vanasco nginx at
Wed Apr 22 18:39:00 MSD 2009

On Apr 22, 2009, at 2:42 AM, Igor Sysoev wrote:
> location ~ "^/(rsvp|pages|careers)/" ?

in it's entirety:

     location ~ ^/(rsvp|pages|careers)/ {
         if ( -f /home/artwelove/_current/web/ 
downtime/-news ) {
             return 503;
         root  /home/artwelove/_current/web/;
         include  /usr/local/nginx/_macros/php.conf;
         index  index.php index.html;

the if block was a trick i learned off this list to handle downtime  
with semaphores

this block works perfectly as an exact match... and these locations  
are just shotcuts to remove a few nested dirs off of a /news main  
location.  reaching this through /news/careers works as intended ;  
rewriting this block to be location /careers works as intended.

More information about the nginx mailing list