1.nginx_add_after_body
语法: add_before_body uri;
默认值: —
配置段: http, server, location
发起一个子请求,请求给定的uri,并且将内容追加到主题响应的内容之前。
语法: add_after_body uri;
默认值: —
配置段: http, server, location
发起一个子请求,请求给定的uri,并且将内容追加到主题响应的内容之后。
syntax: addition_types mime-type …;
default: addition_types text/html;
context: http, server, location
这个指令在0.7.9开始支持,指定需要被追加内容的MIME类型,默认为“text/html”,如果制定为*,那么所有的.
实例演示
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 80 default_server;
server_name www.abc1.com;
root /usr/share/nginx/html;
location / {
add_after_body /ok.html ;
add_before_body /ok.html ;
}
}
include /etc/nginx/conf.d/*.conf;
}
[root@localhost html]# cat index.html ok.html
<h1> add_test </h1>
I am header!
I am body!
结果

1.nginx_add_after_body的更多相关文章
随机推荐
- Linux之用户和权限
自从我大微软终于放下身段,决定给开源社区一个迟来的拥抱,追随多年的拥趸们像是突然得到了女神的垂青,各种茫然失措.痛哭流涕.欢欣鼓舞,纷纷唱了起来:“等了好久终于等到今天,梦了好久终于把梦实现……”唱完 ...
- spring beans源码解读之--总结篇
spring beans下面有如下源文件包: org.springframework.beans, 包含了操作java bean的接口和类.org.springframework.beans.anno ...
- 浅析HttpSession
苏格拉底曰:我唯一知道的,就是自己一无所知 源头 最近在翻阅Springboot Security板块中的会话管理器过滤器SessionManagementFilter源码的时候,发现其会对单用户的多 ...
- c# 图片加水印
/// <summary> /// 图片水印 /// </summary> /// <param name="imgPath">服务器图片相对路 ...
- sql 服务启动失败 SQL Server(MSSQLSERVER) 错误码126
SQL配置管理器-->sql server 网络配置-->mssqlerver的协议-->VIA禁用服务
- JavaScript 运行机制 (Event Loop)
单线程就意味着,所有任务需要排队,前一个任务结束,才会执行后一个任务.如果前一个任务耗时很长,后一个任务就不得不一直等着. 所有任务可以分成两种,一种是同步任务(synchronous),另一种是异步 ...
- 基于Html5 Plus + Vue + Mui 移动App 开发(二)
基于Html5 Plus + Vue + Mui 移动App 开发(二) 界面效果: 本页面采用Html5 Plus + Vue + Mui 开发移动界面,本页面实现: 1.下拉刷新.上拉获取更多功能 ...
- GZIP压缩与解压
public class GZIP { /** * 字符串的压缩 * * @param str * 待压缩的字符串 * @return 返回压缩后的字符串 * @throws IOException ...
- (办公)mysql安装完,只能通过localhost访问,而不能通过本机ip访问.(转)
GRANT ALL PRIVILEGES ON *.* TO '; 这里面*.*代表是所有库.所有表,root是用户名,%代表所有ip都可访问,也可指定ip访问,例如'root'@'172.17.5. ...
- 测者的测试技术手册:智能化测试框架EvoSuite的一个坑以及填坑方法
问题 最近在不断地学习和探索EvoSuite框架的时候,在生产JUnit单元测试框架后,出现如下问题: Exception: Caused by: org.evosuite.runtime.TooMa ...