Last active
August 18, 2022 08:44
-
-
Save sergejmueller/0e508f3a4d92fd7ec110 to your computer and use it in GitHub Desktop.
Stop search engines from indexing .txt, .log, .xml, .css and .js files in Nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~* \.(txt|log|xml|css|js)$ { | |
add_header X-Robots-Tag noindex; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @sergejmueller
I've expanded this to noindex non-programming files that Google claims to index.
Ref: https://github.com/littlebizzy/slickstack/edit/master/modules/nginx/sites/production.txt