server { listen 80; server_name ~^www.(?.+)$; return {{REDIRECT_CODE}} {{REDIRECT_SCHEME}}://$domain$request_uri; }