Answer the question
In order to leave comments, you need to log in
How to tell nginx that the robots.txt file is on another server?
Hi everyone, there is a site site.com moved all the statics to a separate site.info server,
but I can’t configure nginx to give the robots.txt file from the site.info site when requesting it to site.com/robots.txt.
Tried:
location /robots.txt {
allow all;
log_not_found off;
access_log off;
alias http://site.info/robots/robots.txt;
}
location /robots.txt {
allow all;
log_not_found off;
access_log off;
return 301 http://site.info/robots/robots.txt$request_uri;
}
location /robots.txt {
allow all;
log_not_found off;
access_log off;
return http://site.info/robots/robots.txt;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question