Skip to main content

How to block search engines in the nginx

Updated 1 min readMarkdown
How to block search engines in the nginx

If you have three layered development structures (local dev, remote staging, remote production) like me, you want to search engines index your staging server. It is easy to prevent search engines from indexing your Nginx web server.

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

Add the line above in the server block virtualhost file and Google forget the way to go to your server.

About the author

  • Hey, y’all 🖖🏽 I am a passionate self-taught developer, open-source advocate, and tech enthusiast with a hands-on approach to problem-solving and an unending thirst for knowledge. Anything and everything classified as technology fascinate me.

No comments yet. Be the first to comment.