I am having the same problem - I need to detect if the connection is using SSL or not.
I used to use
if ($http_x_forwarded_proto = "http") { return 301 https://$host$request_uri; }
but now I switched to proxy_protocol and I'm not seeing a way to detect if SSL is being used. It seems there should be a $proxy_prototcol_proto and/or $proxy_prototcol_port variables but they don't seem to exist.
I used to use
if ($http_x_forwarded_proto = "http") { return 301 https://$host$request_uri; }
but now I switched to proxy_protocol and I'm not seeing a way to detect if SSL is being used. It seems there should be a $proxy_prototcol_proto and/or $proxy_prototcol_port variables but they don't seem to exist.