Here are the configurations to prevent search engines (Google, Bing, etc.) from indexing all sites on your server using global configuration for both web servers Apache and Nginx:
Prevent search engines indexing in Apache
Add the following line in httpd.conf or apache2.conf: