Fix redirects when using proxy