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