wodby/nginx

Nginx Drupal 8 preset is not compatible with robotstxt module

Closed this issue ยท 3 comments

Steps to reproduce:

  • Up and running Docker4Drupal stack;
  • Installed the latest version of Drupal 8.
  • removed web/robots.txt file;
  • enabled robotstxt module on Drupal 8 installation;
  • go to the /robots.txt page;

Expected results:

  • Status code - 200;
  • Returned default content of robots.txt file provided by robotstxt module;

Actual result:

  • Status code - 404;
  • No result provided. No request redirected to index.php when robots.txt file not exists.

It looks like support for dynamically generated robots.txt file was added with this commit: 81e32d1

Adding the following to a custom site.conf.tmpl file allows Drupal to serve a dynamic robots.txt file:

location = /robots.txt {
    try_files $uri @drupal;
}

Note that this issue also affects the Drupal 7 preset.

The maintainer added support for the WordPress template. Drupal templates (supported versions) need the same configuration.

Added robots.txt support