+
95
-

回答

可以使用ngx_http_addition_module模块,必须在编译的时候添加过--with-http_addition_module

location / {
add_before_body /hello.html
add_after_body /after.html;
}

注意,hello.html与after.html可以写一些添加到html前面和后面的代码,例如hello.html中代码为hello,after.html代码为after,

那么请求一个html文件demo.html,里面包含代码demo,那么实际返回的代码就是hello demo after

网友回复

我知道答案,我要回答