Regular Expression global redirect

Edho Arief edho at
Sun Feb 26 07:29:02 UTC 2012

2012/2/26 altiamge <nginx-forum at>:
> I'm not able to get either one of these to work. I just upgraded to
> nginx 1.0.12 just to make sure my version wasn't an issue. I also
> checked my PCRE version.
> # pcretest
> PCRE version 6.6 06-Feb-2006

Your pcre is too old. I believe the workaround is by appending P
before the capture name.

server_name ^~www\.(?P<domain>.*)$;

More information about the nginx mailing list