• Nginx笔记总结十五:nginx+keepalive+proxy_cache配置高可用nginx集群和高速缓存


    nginx编译
    wget http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz
    ./configure --prefix=/usr/local/nginx --add-module=../ngx_cache_purge-2.3 --with-http_stub_status_module --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module
    配置:
    proxy_cache_path /data/proxy_cache_dir levels=1:2 keys_zone=cache_one:50m inactive=1m max_size=2g;
      upstream real_server_pool {
        server 192.168.200.148:80 weight=1 max_fails=2 fail_timeout=30s;
        server 192.168.200.149:80 weight=1 max_fails=2 fail_timeout=30s;
      }
    service {
      listen 80;
      server_name localhost;
      location / {
        root html;
        index index.html index.htm;
        proxy_next_upstream http_502 http_504 wror timeout invalid_header;
        proxy_cache cache_one;
        procy_cache_valid 200 304 12h;
        proxy_cache_key $host$uri$is_args$args;
        proxy_set_header Host $host;
        prox_set_hreader X-Forwarded-For $remote_addr;
        proxy_pass http://real_server_pool;
        expires 1d;
      }
    }
  • 相关阅读:
    Adobe Acrobat XI Pro破解版 v11.0.10中文版
    linux经典面试题
    P1540 机器翻译(STL 链表)
    P1067 多项式输出 (模拟)
    P1003 铺地毯
    [CF547C] Mike and Foam
    [CF351B] Jeff and Furik
    [CF900D] Unusual Sequences
    [CF568B] Symmetric and Transitive
    [CF893E] Counting Arrays
  • 原文地址:https://www.cnblogs.com/djoker/p/6396487.html
Copyright © 2020-2023  润新知