I want to write mod_layout the right way. layout have to insert "header" after the body element, or at the top it there is no body element, but there should be no header when there is no body and there is </frameset> on the page. I modified sub_filter_module: http://rkd.republika.pl/NGINX/ngx_http_sub2_filter_module.c
Config options are similar to sub_filter. I'm using: sub2_filter <body 'HEADER<br/>'; sub2_filter_once on; sub2_frameset </frameset>;
Sometimes it works, but when I set output_buffers to 1 1; it stopped working with html like this: <frameset cols="50%,50%"> <frame name ="a" src="a.html"/> <frame name="b" src="b.html"/> </framset>
How to make it work, especially how to achieve inserting something before whole document, when there is no <body> in the document?