Answer the question
In order to leave comments, you need to log in
Why are sitemap.xml and robots.txt files not available in production?
Rails 5.0.0.
On the server, in the public directory, there are rights confirmation files (for example, Google and Yandex), sitemap.xml and robots.txt.
All these files are not available at site.ru/filename.
In development mode in the console by command: curl http://site.ru/robots.txt
I get the contents of the file. Yes, and in the browser, too, I see its contents.
But as soon as the site is launched in production mode, then on command (and in the browser) either the cache from the previous (development) launch or a 404 error (an error from Rails) is displayed.
Why is this happening and how to fix it? How do you solve that problem in your projects?
Answer the question
In order to leave comments, you need to log in
OP, do not listen to Andryusha, nginx should give these files, as well as assets
location ~ ^/(robots.txt|sitemap.xml.gz)/ {
root /home/ne_slushai_andreya_on_dyrachok_ne_ot_mira_sego/apps/example/current/public;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question