: This article describes how to solve the nginx error: rewriteorinternalredirectioncyclewhileinternallyredirectingto. if you are interested in the PHP Tutorial, refer to it. Configure nginx + php-fpm and access the home page. an error is returned:
23:04:39 [error] 10964 #2788: * 2 rewrite or internal redirection cycle while internally redirecting to "/", client: 127.0.0.1, server: bk, request: "GET/HTTP/1.1", host: "bk"
Cause of error: caused by the index command. the solution is to change try_files $ uri/; to try_files $ uri/= 404;
Note: No space is allowed between the equal sign of = 404 and 404.
Complete configuration: bk. conf source code is as follows (if you need to reprint, please mark the original author default.fu@foxmail.com ):
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;}}
The above describes how to solve the nginx error prompt: rewrite or internal redirection cycle while internally redirecting to "/", including some content, hope to be helpful to friends who are interested in PHP tutorials.