@ -0,0 +1,14 @@
error_page 418 = @www;
set $www "0";
if ( $http_host ~* "^www\.") {
set $www "${www}1";
}
if ( $http_host ~* "^m\.") {
set $www "${www}2";
if ( $www = "0" ) {
return 418;
location @www {
rewrite ^ $scheme://www.$host$request_uri? permanent;