What does this nginx error "rewrite or internal redirection cycle" mean?
It's a strange one all right, though I'm going to bet the problem is with:
try_files $uri $uri/ /index.html;
The problem here is that the second parameter here,
$uri/, causes each of the files in your
index directive to be tried in turn. If none are found, it then moves on to
/index.html, which causes the same
location block to be re-entered, and since it still doesn't exist, you get an endless loop.
I would rewrite this as:
try_files $uri $uri/ =404;
to return a 404 error if none of the index files you specified in the
index directive exist.
BTW, those requests you are seeing are Internet background noise. In particular, they are probes to determine whether your web server is an open proxy and can be abused to hide a malicious user's origin when he goes to perform malicious activity. Your server isn't an open proxy in this configuration, so you don't really need to worry about it.
You will also get this error message if your
index.php is entirely missing.
This was annoying. It was working a few weeks ago, and it failed on me when I tried today.
I believed an upgrade of Ubuntu
nginx package cause the default directory of where Ubuntu kept the standard index files changed, so the line:
Won't work anymore as the location of the files are at
To fix, one can just change the root pointer to the correct directory, or create a symlink to the new directory:
sudo ln -s html www
Works for me.
I ran into this problem yesterday because I was testing nginx over a proxy server that had cached a redirect that no longer existed. The solution for me was to
$ sudo service squid3 restart on the squid3 proxy server I was connecting through.
Had this error today, spend a few hours figuring the cause. Turned out someone deleted all the site's files.