Tweak the logic of https redirect via X-Forwarded-Proto