nginx add_header指令使用方法
2014-03-05 11:46
766 查看
response header一般都是以key:value的形式,例如:“Content-Encoding:gzip、Cache-Control:no-store”,设置的命令为:
add_header Cache-Control no-store
add_header Content-Encoding gzip
但是有一个十分常用的response header比较特性,就是Content-Type,可以在它设置了类型的同时还会指定charset,例如:“text/html; charset=utf-8”,由于其存在分号,而分号在配置文件中作为结束符,所以在配置的时候需要用引号把其引起来,配置如下:
复制代码 代码如下:add_header Content-Type 'text/html; charset=utf-8';
另外由于没有单独设置charset的key,所以要设置响应的charset就需要使用Content-Type来指定charset。
您可能感兴趣的文章:
相关文章推荐
- 【随笔】nginx add_header指令的使用
- linux系统中top指令的详细使用方法以及一些符号的含义
- AngularJS使用ng-inlude指令加载页面失败的原因与解决方法
- Python3中urllib详细使用方法(header,代理,超时,认证,异常处理)
- 解决wordpress使用wp_redirect函数出现Warning: Cannot modify header information的方法
- INT 21H 指令说明及使用方法
- ligerui设置页签项标题setHeader方法的使用
- php使用curl获取header检测开启GZip压缩的方法
- ASP2.0中的HtmlHeader的一些使用方法
- mysql中show指令详细使用方法
- 代码指令mac 下 SVN使用方法
- ListView.addHeaderView之后,使用onItemClick方法注意
- 使用cmd执行指令,遇到中间有空格的路径处理方法
- 九、访问内存的要素以及INC和LOOP指令和Debug使用方法的扩
- header(Location)标准的使用方法
- 关于Delphi中预编译指令的使用方法
- SecureCRT的使用方法和技巧(二) 常用指令
- 关于Delphi中预编译指令的使用方法
- 【ZZ】一些在php中使用header函数设置http头的示例方法
- node.js中的http.response.removeHeader方法使用说明