php and locations with regex (round 2)

Alejandro Vartabedian lists at webservice.com.uy
Wed Oct 24 16:40:47 MSD 2007


Igor Sysoev escribió:
> On Wed, Oct 24, 2007 at 10:31:48AM +0200, Grzegorz Nosek wrote:
>
>   
>> 2007/10/23, Igor Sysoev <is at rambler-co.ru>:
>>     
>>> You may use:
>>>
>>>       location ~ \.php$ {
>>>           fastcgi_pass   ...
>>>           ...
>>>       }
>>>
>>>       location ~ ^/(app1|app2)/ {
>>>           root    ...
>>>           ...
>>>       }
>>>       
>> This gets ugly quickly if you decide one day to e.g. pass different
>> php files to different fastcgi backends (running under different users
>> or something). Also, if I'm right, errors while serving php pages come
>> from the first location, so requests for /app1/nonexistent.php and
>> /app1/nonexistent.jpg may result in different error handling.
>>     
>
> I agree. I personally prefer to avoid such general locations and
> try to describe more detailed locations. It seems redudant for simple sites
> with several locations, but my practice shows that sites usually grow
> and these general locations become cumbersome.
>
>   
sure i agree, the use i do of this is a simple rewrites include for
specific app subdirs, and i think one location by app subdir is a little
redundant.
thanks you all, interesting concepts and knowledge are emerging form
those threads (IMHO)






More information about the nginx mailing list