server declaration in my nginx.conf:
listen 1.2.3.4:443 ssl;
root /var/www/myapp/current/public;
ssl on;
ssl_certificate /etc/nginx-cer
You need to add the following line:
proxy_set_header X-Forwarded-Proto https;
as in
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://upstreamy;
break;
}
}