Com’è la tua configurazione nginx e hai un header X-Forwarded-Proto al suo interno?
X-Forwarded-Proto