Nginx: added authentication, fixed redirects