Middleware changes to redirect to https on production