The command sudo nginx -t checks all files, including those in sites-available. If you try to check a file with the command sudo nginx -t -c /etc/nginx/sites-available/$filename, it will result in various errors, as those files usually do not correspond to the normal nginx configuration. More information can be found here.