Nginx point subdirectory to root

How can I point www.domain.com/ru/ to open the content of www.domain.com/ ?

Not a redirect.

I have tried alias and root but can't figure how to make it work.

Thank you.


If you mean an internal rewrite, then this should work:

location ^~ /ru {
    rewrite ^/ru(.*)$ $1 last;
}

The ^~ modifier ensures that this location takes precedence over any regex location so that your .php URIs are rewritten too.

See this and this for details.