Thanks Richard for replying but somehow this is not working. I see it is being redirected to http://www.example.com/fhu but not to http://www.example.com/fhu/foo and http://www.example.com/fhu/bar. As you mentioned I have matched the case exactly. Posted at Nginx Forum: https://forum.nginx.org/read.php?2,275218,275226#msg-275226