Rewrite with number after hyphen

Ivan Bianchi ivan at
Mon Sep 3 06:13:11 UTC 2018


I detected an issue with my rewrite rule in the nginx.conf and I don't
understand why it happens and how to fix it.

I have tested in two environments with versions 1.10.3 and 1.14.0.

Having the following simple conf with a regex is intended to get everything:

> location /foo {
> rewrite /foo/(.*) /web/$1 last;
> }





As implementing pcre regex, this regex works in all cases in the common
regex online sites but not in nginx.

Why if I put a number after a hyphen the regex stops working?

Many thanks,

Ivan Bianchi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list