update router to better handle ngnix rewrite urls