Nginx: Difference between revisions
Malteneuss (talk | contribs) m Add rebind attack notice |
Add robots.txt |
||
| Line 70: | Line 70: | ||
}; | }; | ||
}; | }; | ||
</syntaxhighlight> | |||
'''Robots.txt''' | |||
If you want to set a robots.txt for your domain (or any subdomains), add this: | |||
<syntaxhighlight lang="nix"> | |||
locations."/robots.txt" = { | |||
extraConfig = '' | |||
rewrite ^/(.*) $1; | |||
return 200 "User-agent: *\nDisallow: /"; | |||
''; | |||
}; | |||
</syntaxhighlight> | </syntaxhighlight> | ||