Sub_filter only filters and allow change inside <body> tag elements not with <head> and <body> replacement itself.
<head>
<!--- sub filter doesnt work here ---->
<!-- need to append js here -->
</head>
<body>
<!--- sub filter doesnt work here ---->
<h3> <!- sub_filter can apply here --></h3>
.................
................
<div> <h3> <!- sub_filter can apply here --></h3> </div>
<!--- sub filter doesnt work here ---->
</body>
I tried with body filter too. no success. just illustrate any example if that is possible along with suitable code. I needed to append js in lua land because i needed to set some cookie variable into js part too, so working on location block will be messy. Do u have any suggestions with body filter directive or any other without adding any dependency? Thanks