I also ran in this issue, but adding proxy_ssl_server_name didn’t work for me. In my scenario, my nginx is receiving http connections from an AWS LoadBalancer where the SSL is terminated.
My solution to this problem was to add the Host header containing the proxy_pass hostname to the location configuration.
proxy_set_header Host "http://myapp.com/";
proxy_pass http://myapp.com/;
Only then my requests were correctly answered by the proxy_pass endpoint.
Most likely, apache’s request add the Host header and nginx doesn’t.