首页 > 其他 > 详细

nginx参数小说明

时间:2014-10-04 03:24:36      阅读:246      评论:0      收藏:0      [点我收藏+]

proxy_set_header  重新封装包头,和日志格式有关系,定义在location里面
proxy_cache       是否开启nginx缓存,定义在location里面
proxy_cache_vaild 对于http的什么状态码进行缓存以及缓存的时间,定义在location里面
proxy_cache_path  缓存的路径,定义在server外面,location定义在server里面
add_header        添加包头,定义在location里面

例子:

proxy_cache_path /data/nginx/cache levels=1:2:1 keys_zone=one:10m;缓存的文件在哪儿,缓存文件的属性;

proxy_cache_valid  200 302  10m;  对于202  302状态码缓存10分钟。

proxy_set_header Host $host:80;
proxy_set_header X-Forward-For $remote_addr;

add_header        X-Cache   $upstream_cache_status;

add_header        X-Via  $server_addr;

add_header        X-Cache   "$upstream_cache_status  from   $remote_addr"

本文出自 “常用文档” 博客,请务必保留此出处http://yujianglei.blog.51cto.com/7215578/1560541

nginx参数小说明

原文:http://yujianglei.blog.51cto.com/7215578/1560541

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!