What does your nginx config look like and do you have an X-Forwarded-Proto header in it?
X-Forwarded-Proto