w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
nginx error "rewrite or internal redirection cycle" on CakePHP Project

Your error is this:

$ 2014/06/14 09:39:22 [error] 5952#0: *1 rewrite or internal redirection cycle while processing "/backhaus", client: xxx.x.x.xx, server: azazel, request: "GET /backhaus HTTP/1.1", host: "azazel"

And the error clearly states:

…redirection cycle while processing "/backhaus"…

So now, let’s look at your posted Nginx config:

location /backhaus {
  root /var/www/backhaus/app/webroot/;
  index index.php;
  rewrite ^/* /backhaus;
  location ~ ^/(.+.php)$ {
          try_files $uri $uri/ =404;
          include /etc/nginx/fastcgi_params;
          fastcgi_pass unix:/var/run/php5-fpm.sock;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

It seems like the issue is your location is /backhaus but then you are redirecting any traffic going to /backhaus to /backhaus via this line:

rewrite ^/* /backhaus;

So I would recommend just removing that rewrite line.

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.