Answer the question
In order to leave comments, you need to log in
Why is robots.txt not available in production?
When run in development, the file is available at site.ru/robots.txt.
As soon as I run it in production, I get a 404 error. What's the problem?
Answer the question
In order to leave comments, you need to log in
because in development mode the rails server also gives the statics from the public folder, because it's practical
Ruby is too slow to do it in production, your main web server - nginx or at least apache should do it in
config/environments/production. rb
rails < 4 - config.serve_static_assets = true
rails = 5 - config.serve_static_files = true
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question