Updating some old "if" statements

Edho Arief edho at myconan.net
Sat Sep 29 03:46:51 UTC 2012


On Sat, Sep 29, 2012 at 8:38 AM, Ian Evans <ianevans at digitalhit.com> wrote:
> 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>
>

I also wrote it wrong, should be /pixcache$request_uri/index.html



More information about the nginx mailing list