Error: Rewrite or internal redirection cycle after some time

thiagotognoli nginx-forum at nginx.us
Fri Sep 14 18:47:09 UTC 2012


My nginx configuration works fine, but suddenly after some time (mostly
days) he begins to answer 3x and the error occurs in the log below for all
requests:

2012/09/13 17:15:35 [error] 26027#0: *4923 rewrite or internal redirection
cycle while processing "/index.php", client: 201.26.2.XXX, server:
www.XXX.com.br, request: "GET /checkout/cart/ HTTP/1.1", upstream:
"fastcgi://unix:/var/run/php5-fpm-xxx.sock:", host: "www.XXX.com.br",
referrer: "http://www.XXX.com.br/product-xxx.html"


The error only after I reload nginx configuration with "/etc/init.d/nginx
reload"

What can it be?

My host config:

server {
	listen xxx.com.br:80 default;
	
	server_name www.xxx.com.br *.xxx.com.br;
	root	/home/xxx/www/;

	
	location ~ ^/(admin|index\.php/admin) {
		rewrite / https://$host$request_uri permanent;
		break;
	}
	
	rewrite ^/minify/([0-9]+)(/.*.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last;
	rewrite ^/skin/m/([0-9]+)(/.*.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last;
	
	location / {
		index index.php index.html;
		try_files $uri $uri/ @handler;
		expires 30d;
	}


	location ^~ /app/                { deny all; }
	location ^~ /includes/           { deny all; }
	location ^~ /lib/                { deny all; }
	location /lib/minify/		 { allow all;}
	location ^~ /media/downloadable/ { deny all; }
	location ^~ /pkginfo/            { deny all; }
	location ^~ /report/config.xml   { deny all; }
	location ^~ /var/                { deny all; }
	
	location ~/(cron\.sh|cron\.php|mage)$ { deny all; }
	location ^~ /app                { deny all; }
	location ^~ /includes           { deny all; }
	location ^~ /lib           		{ deny all; }
	
	location ^~ /downloader			{ deny all; }
	location ^~ /errors/.*\.(xml|phtml)$ { deny all; }
	location ^~ /media/customer	 	{ deny all; }
	location ^~ /media/downloadable { deny all; }
	location ^~ /pkginfo           	{ deny all; }	
	location ^~ /shell            	{ deny all; }
	location ^~ /report/.*\.(xml|phtml)$ { deny all; }
	location ^~ /var                { deny all; }

	location  /. { ## Disable .htaccess and other hidden files
		return 404;
	}

	location @handler { ## Magento uses a common front handler
		rewrite / /index.php;
	}
     
	location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant
handler
		rewrite ^(.*.php)/ $1 last;
	}
     
	location ~ .php$ { ## Execute PHP scripts
		if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s
that try_files miss
		
		include /etc/nginx/naxsi.rules;
		
		expires        off; ## Do not cache dynamic content
		fastcgi_pass   unix:/var/run/php5-fpm-xxx.sock;
		include        fastcgi_params; ## See /etc/nginx/fastcgi_params
		fastcgi_param  HTTPS	$http_https;
		#fastcgi_param  HTTPS	off;
		fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
		fastcgi_param  MAGE_RUN_TYPE  store;
		fastcgi_param  MAGE_RUN_CODE $magesite_xxx;
		break;
	}
}

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,230733,230733#msg-230733



More information about the nginx mailing list