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.

Leave a Comment