使用rewrite跳转,将 test.wtyx.com/robots.txt 跳转到 test.wtyx.com/robots_disable.txt上
location /robots.txt {
rewrite (.+) http://test.wtyx.com/robots_disable.txt permanent;
}
第二种不用跳转重新定义test.wtyx.com/robots.txt的根目录
location /robots.txt {
root /srv/www/html;
# rewrite (.+) http://test.wtyx.com/robots_d.txt permanent ;
}