index.php is added in front of paths for anonymous users I have a new Drupal 8.0.4 site running on Nginx, and I just noticed that the paths for anonymous users have a superfluous index.php in front of them. 

So instead of 

mysite.com/node/123


I get the following when not logged in

mysite.com/index.php/node/123


I'm not entirely sure if it was this way since I started building the site, because I was usually logged in I might not have noticed it. But it could also have happened only since I upgraded Drupal core to the latest minor version.

My Nginx configuration is based on the official Nginx recipe for Drupal, with some small differences in the php-fpm configuration for PHP 7.

As mentioned in the comment by Sachbearbeiter, this seems to be an intermittent issue. I don't see it anymore now on my site, some days later.

Any idea what is causing the index.php to be inserted and how I can get rid of it at all times?
This is mainly an SEO issue. Search engines seem to like unclean URLs with index.php. Once they found one all internal links on your site also contain index.php and so they sometimes crawl the entire site in this namespace.

You have to return a 301 redirect for any unclean URL to stop this. Install the module Redirect and go to the module settings /admin/config/search/redirect/settings:


  GLOBAL REDIRECTS
  
  [x] Enforce clean and canonical URLs.
  
  Enabling this will automatically redirect to the canonical URL of any page. That includes redirecting to an alias if existing, removing
  trailing slashes, ensure the language prefix is set and similar
  clean-up.