Request exceeded the limit of 10 internal redirects

After migration from owncloud to nextcloud I get error 500 from apache webserver.

Apache log says:
AH00124: Request exceeded the limit of 10 internal redirects due to probable configuratio
n error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace.

With LogLevel debug I see the redirect loop in the error log:
AH00121: r->uri = /index.php
AH00122: redirected from r->uri = /php5-fcgi/index.php
AH00122: redirected from r->uri = /index.php
AH00122: redirected from r->uri = /php5-fcgi/index.php
AH00122: redirected from r->uri = /index.php
…

Apache Config for php5-fpm:

AddHandler php5-fcgi .php .html
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /homepages/mycloud/htdocs/php5-fcgi
FastCgiExternalServer /homepages/mycloud/htdocs/php5-fcgi -idle-timeout 1000 -socket /var/run/php5-fpm_mycloud.sock -pass-header Authorization

Without .htaccess everything works fine.

Debian version 8.6
apache2-mpm-worker 2.4.10-10+deb8u7
php5-fpm 5.6.24+dfsg-0+deb8u1

Anyone knows how th solve this problem?

Check out the apache community. By default our configuration is tested with mod_php. There is also a configuration example for nginx with fastcgi and there have been some reports that in some cases these fastcgi/fpm/… configurations can create problems (or these users weren’t able to figure out a proper configuration).

Hi,

Did you ever figure out this problem. It’s happened to me again when i upgraded to Nextcloud 10.0.2

Thanks,
Wayne

There was some other issue with fcgi, not sure if you can configure your server like this and if this is an option for you:

I added the folowing code to my .htaccess:

RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
RewriteCond %{REQUEST_URI} !^/php5-fcgi/
RewriteRule . index.php [PT,E=PATH_INFO:$1]

My Apache config looks like:

AddHandler php5-fcgi .php .html
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /homepages/nextcloud/htdocs/php5-fcgi
FastCgiExternalServer /homepages/nextcloud/htdocs/php5-fcgi -idle-timeout 1000 -socket /var/run/php5-fpm_nextcloud.sock -pass-header Authorization