Updating some old "if" statements

Ian Evans ianevans at digitalhit.com
Sat Sep 29 01:38:42 UTC 2012


Thanks for the new locations!

>> Location #2:
>>
>> location ~ ^/galleries(/.*$|$) {
>> if (-f /usr/local/nginx/htdocs/pixcache$request_uri/index.html) {
>> expires 2h;
>> rewrite ^(.*)$ /pixcache$1/index.html last;
>> break;
>> }
>> rewrite ^/galleries(/.*$|$) /galleries.php?mypath=$1 last;
>> }
>>
>
> location ~ ^/galleries(?<mypath>/.*$|$) {
>    expires 2h;
>    try_files /pixcache$mypath/index.html /galleries.php?mypath=$mypath;
> }

I have an older PCRE with my CentOS version, so am I write in 
remembering the named regex can be changed to from ?<mypath> to ?P<mypath>

Thanks again.



More information about the nginx mailing list