php and locations with regex (round 2)

Alejandro Vartabedian lists at webservice.com.uy
Tue Oct 23 20:26:10 MSD 2007


;-) i tried something like this before posting the last mail, but i
think this mixture is out of context (somebody correct me please), it's
a rewrite module directive, and fastcgi params doesn't fit in it (yet ;).

i think i'm out of luck with the simplification/generalization of the
config directives i pretend.

thank you all, i'm learning a lot about nginx...

Grzegorz Nosek escribió:
> 2007/10/23, Alejandro Vartabedian <lists at webservice.com.uy>:
>   
>> well, doing this work:
>>
>>         location ~ /(app1|app2)/ {
>>             root   /home/website/beta.ws/webroot/;
>>             index  index.php index.html index.htm;
>>     
>
> if (!-f $request_filename) {
>
>   
>>             fastcgi_pass   127.0.0.1:8888;
>>     
>
> }
>
>   
>>             fastcgi_index  index.php;
>>             fastcgi_param  SCRIPT_FILENAME
>> /home/website/beta.ws/webroot$fastcgi_script_name;
>>             include        /etc/nginx/fastcgi_params;
>>         }
>>
>> but i'm charging to php to serve _all_ the data, dynamic and static one
>> (correct?)
>> is there a way to filter inside the location the php-cgi directives to
>> serve directly the static content and avoid overcharging php?
>> thanks.
>>     
>
> Try wrapping fastcgi_pass in an `if' block, like above. Please check
> the variable name as I'm not 100% sure about it right now.
>
> Best regards,
>  Grzegorz Nosek
>   







More information about the nginx mailing list