I'm using wildcard in server_name. I want to redirect all subdomains of example.com (configured as *.example.com) to foo.com except xyz.example.com
I have configuration as follows
server {
        listen          80;
        server_name     *.example.com;
        location / {
            proxy_pass      http://$1.foo.com;
        }
}
I don't want to change any request coming to xyz.example.com
 
     
    