rewrite rules issue

nicocolt nginx-forum at
Sun Apr 19 08:06:55 UTC 2015


Thanks for your reply.

If I remove the three lines, i get a 404 error. As a reminder, and maybe a
little bit more clear :) here is the configuration.

Here is the directory path:


my nginx conf is:

root /var/www/

if ($http_host = "") {
            rewrite ^(?!/\b(subdomain|stats|error)\b)/(.*)$ /subdomain/$2

The if statement is before all of location directives.

After purging my cache browser, this is what I get:

when i reach i'm redirected to (this is not what i want, i

Thanks fo your help,
Best regards,

Posted at Nginx Forum:,258184,258190#msg-258190

More information about the nginx mailing list