Nginx 444 how to configure it

I run an email server with for the moment 6 mail domains. I am new to Nginx but want to use status code 444 to block direct ip access to any of the domains. Do I have to change in all domain conf or can I do it just in the default 00-default.conf 000-default.conf

Anders