Fix nginx error hint: rewrite or internal redirection cycle while internally redirecting to "/",

Source: Internet
Author: User



Configure the NGINX+PHP-FPM, visit the homepage, prompt error:



2015/01/14 23:04:39 [ERROR] 10964#2788: * * Rewrite or internal redirection cycle while internally redirecting to "/", Clie nt:127.0.0.1, SERVER:BK, Request: "get/http/1.1", Host: "BK"






cause of Error:index instruction, solution to try_files $uri $uri/; Change to Try_files $uri $uri/= 404;



Special Note:There can be no spaces between the =404 equals sign and 404.



Complete configuration: bk.conf source code as follows (if you need to reprint, please mark the original author [email protected]):








server {
	listen       80;
	server_name  bk;
	root d:/website/bk.com/www;
	index index.html index.htm index.php;
	
	location / {				
		try_files $uri $uri/ =404;
	}
	
	location ~ \.php$ {
		fastcgi_pass   127.0.0.1:9000;
		fastcgi_index  index.php;
		fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
		include        fastcgi_params;    
		try_files $uri =404;
	}
	

	#error_page  404              /404.html;

	# redirect server error pages to the static page /50x.html
	#
	
	error_page   500 502 503 504  /50x.html;
	#location = /50x.html {
	#	root   html;
	#}
	
	location ~ /\.(ht|svn|git) {
		deny all;
	}
}






Fix nginx error hint: rewrite or internal redirection cycle while internally redirecting to "/",


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.