Fix issues when using reverse proxy