nginx: Prevent search engines from indexing your development server

If you nginx powered development instances are showing up in Google search results, there is a quick and easy way to prevent search engines from crawling your site. Add the following line to the location block of your virtualhost configuration file for the block that you want to prevent crawling.

add_header  X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";

One thought on “nginx: Prevent search engines from indexing your development server

Leave a Reply

Your email address will not be published. Required fields are marked *