I also encountered this problem, after many hours of troubleshooting, found that by commenting out the line proxy_set_header X-Forwarded-Proto $scheme;
, problem solved.
Perhaps the jenkins itself build the 302 redirect url with header X-Forwarded-Proto
if it exists