Redirect any subdomain http or https to a single subdomain with NGINX

Today I had a use case where I wanted to redirect any subdomain at any scheme (http or https) to a single https subdomain should redirect to should redirect to In order to redirect both schemes (http and https) to a single subdomain you have to setup two server blocks. […]