zoukankan      html  css  js  c++  java
  • nginx 配置维护页面 添加缓存

    如果需要在维护阶段将所有的请求打入某个网页的配置:
    server {
           listen 80;
           server_name mz.caiqr.cn;
           root /data/caiqiu/webLottery/wapBetting/develop/;
           rewrite ^(.*)$ /system_repair.html break;
    }
     
    页面添加gzip进行压缩json
    gzip on;
    gzip_disable "msie6";
     
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_buffers 16 8k;
    gzip_http_version 1.0;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
     
    配置某个接口nginx缓存的问题
     
    proxy_cache_path /data/nginx_cache levels=1:2 keys_zone=caiqiu_cache:10m max_size=10g inactive=60m;
     
     
    #首页的 请求期次的另外开一个请求
    location /cache_api_post_data_ren {
              proxy_set_header Referer "";
              proxy_set_header host $host;
              proxy_set_header X-Forwarded-For $remote_addr;
              proxy_cache caiqiu_cache;
              proxy_cache_methods GET;
              proxy_ignore_headers Cache-Control;
              proxy_cache_valid any 1s;
              proxy_pass http://127.0.0.1:8888/cache_api_post_data_ren;
    }
    

      

  • 相关阅读:
    数据库相关(转)
    sql之left join、right join、inner join的区别
    PHP面试编程
    实验6 shell程序设计一(1)
    实验7 shell程序设计二(1)
    Linux软件安装管理
    Linux常用命令总结
    合唱团
    linux课后作业1
    linux网络服务实验
  • 原文地址:https://www.cnblogs.com/zerohu/p/6293451.html
Copyright © 2011-2022 走看看