How to remove the "IF" in this fcgi config

Francis Daly francis at daoine.org
Sat Feb 23 13:41:14 UTC 2013


On Sat, Feb 23, 2013 at 02:05:56AM +0400, Valentin V. Bartenev wrote:
> On Saturday 23 February 2013 00:11:26 Francis Daly wrote:

> >                location ~ ^(?<script_name>.+\.php)(?<path_info>/.*|$) {

>    location ~ ^(?<script_name>.+\.php)(?<path_info>/.*)?$ {
> 
> looks better.

Agreed.

And it means I don't have to think about whether AB|C groups as (AB)|(C)
or (A)(B|C) in this regex implementation :-)

> % pcretest -b -d -m -s+ 

Using smaller Memory allocation numbers is an extra bonus.

Cheers,

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list