The robots.txt file should be located in the Magento 2 root folder

See also:

A post was split to a new topic: What’s needed for the correct robots.txt file to be served on the root folder?