rewrite rules issue

Francis Daly francis at
Sat Apr 18 21:03:16 UTC 2015

On Sat, Apr 18, 2015 at 04:08:54PM -0400, nicocolt wrote:

Hi there,

> if ($http_host = "") {
>             rewrite ^(?!/\b(subpath|stats|error)\b)/(.*)$ /subpath/$2 last;
> }
> if in my browser i write:
> (without last /), then I'm redirected to
> (with a 404 error of course)

Are you reporting that when you have the three lines above in your config,
you get this behaviour; and when you remove those three lines from your
config, you do not get this behaviour?

Because that seems strange.


Francis Daly        francis at

More information about the nginx mailing list