how to add <script> in <header>

Maxim Dounin mdounin at
Tue Dec 29 13:17:03 UTC 2015


On Tue, Dec 29, 2015 at 05:07:37PM +0800, 天河石 - 谢金鹏 wrote:

> I like to add the following entry:
>  <script type="text/javascript" async="async" src=""></script>
> in <head> section. How do I do it?

Assuming you want to do it using nginx, try something like this:

    sub_filter '</head>'
               '<script type="text/javascript" async="async" src=""></script></head>';

See docs here for details:

Maxim Dounin

More information about the nginx mailing list