nginx try_files redirect using wrong scheme when behind SSL termination load balancer (haproxy)

Solution 1:

Fast forward to 2019 and you can:

absolute_redirect off; 
port_in_redirect off;

From docs for absolute_redirect:

If disabled, redirects issued by nginx will be relative.