Nginx: Fixed internal request finalized after rewrite with regex