@adamgins - glad you found out about the stackname - thanks!
The 503/301 thing kind of confuses me because I see https://github.com/jwilder/nginx-proxy/blob/master/nginx.tmpl#L89 which should tell the host to auto-redirect specifically for the virtual hosts that you have setup. You should still be able to use a custom template file though and I think that may work.
Changing return 503 to return 301 https://$server_name$request_uri; will return you https://_ for the entire server if you change it there since _ is specified as the server_name.
listen 80 default_server;
# This is just an invalid value which will never
# trigger on a real hostname.
You can see on line 89 of that same file though, when it's specifying the blocks for each virtual host, it has instead the server_name as your host variable and it does in fact try to send a 301 redirect.
If you want to go ahead though and specify a custom template file where you tell it the server name will always be your host, that would work, however you will lost the ability to use multiple hosts on a single machine. (ex. using AWS EC2 instance hostname + your domain hostname)