SSI include infinite loop

Maxim Dounin mdounin at
Tue May 24 16:59:01 MSD 2011


On Tue, May 24, 2011 at 10:49:45AM +0800, eagle sbc wrote:

> Hello,
> I've encountered a problem about "SSI include infinite loop".
> We have a system that our editors can compose a html page from some
> templates using SSI. Sometimes unwarily combination will cause infinite
> loop, such as 'A include A', 'A include B, B include A', or even 'A include
> B, B include C, C include A'. And this page will cause nginx eating up all
> memories, and certainly won't serve any more unless we restart nginx.
> I'm wondering is there any solution for this problem? Or other ways to avoid
> this?
> I've googled apache and lighttpd, and there also no official solution for
> this, unless lightptd has a patch which will limit the whole 'include'
> count, and I think it's just a tricky way to fix the infinite loop.
> Thanks a lot for any help!

Number of in-flight ssi includes used to be limited in nginx, 
though this limit was broken somewhere near 0.7.25.

This patch brings it back:

Maxim Dounin

More information about the nginx mailing list