I have a multi tenant application which changes styles/content based on the host name. This also means that there is a different sitemap for each site. In order to have a different sitemap for each site I'm going to need to have a dynamically served robots.txt file which updates the sitemap url depending on the current site it's in.
Files not ending in .php won't get sent to PHP-FPM for processing - This is a configuration in the web server, however what and how depends on the web server and how you've configured it.
It's possible you may also need to edit the php-fpm conf to allow .txt as a file extension it will allow to be parsed as PHP, however that protection is off by default.
Instead of you having to create a robots.txt this package will add a x-robots-tag to every request. You can extend the middleware to add custom logic that determines if the tag should be added and what the contents of the tag should be.
Files not ending in .php won't get sent to PHP-FPM for processing - This is a configuration in the web server, however what and how depends on the web server and how you've configured it.
It seems this is not the case. I have been using a package for generating sitemaps "watson/sitemap" and out of the box it's allowed me to create routes for things such as "sitemap.xml" and "sitemap.index.xml"
Also just for testing I created a route for "test.txt" and that also works
The reason that "robots.txt" doesn't work is because both Laravel Homestead and Laravel Forge ship with a line in their nginx vhost configuration that says: