Nginx rewrite question

Igor Sysoev igor at sysoev.ru
Tue Mar 29 13:38:07 MSD 2011


On Tue, Mar 29, 2011 at 01:39:05AM -0400, jinjun502 wrote:
> Hello
>       I want to konw nginx rewrite ,how to write rewrite /indxe.htm to
> /dir/
> ex: http://xxxx.com/index.htm  redirecting http://xxxx.com/

location = / {
    try_files  $uri/index.htm  =404;
    root       /path/to/files;
}

location = /index.htm {
    return  301  http://xxxx.com/;
}


-- 
Igor Sysoev
http://sysoev.ru/en/



More information about the nginx mailing list