For an automatic transition from www to no www, this code works well
if ( $host ~ ^www.(?<domain>.+) ) {
rewrite ^/(.*)$ $scheme://$domain/$1;
Express.js does not support http/2. Or am I wrong? Does it make sense to include http/2 support in nginx?