使用ngx_http_footer_filter_module包含的语法 注意确认是否已经加载此模块
①修改配置文件并重载服务
shell > vim /usr/local/tengine/conf/nginx.conf
语法规则:
#可定义在http、server、location中,建议在server中
#定义需要插入footer的响应类型(Response Content-Type)。
footer_types "text/plain" "text/css" "application/x-javascript";
#在上面定义的HTTP响应的正文结尾插入指定的format内容。如果format中含有变量,会被替换为变量当前的值。
footer "$host_comment";
示例配置:
location / {
root html;
#开启加载注释页脚信息
footer_types "text/plain" "text/css"