server { ... server_name *.xxxx.com; server_name_in_redirect off; location ~ \.php$ { .... fastcgi_param SERVER_NAME $host; } }