a616652325 发表于 2018-11-9 06:16:34

nginx之proxy模块使用

upstream localhost {  server 192.168.18.241:80;
  server 192.168.18.241:81;
  server 192.168.18.241:82;
  }
  proxy_cache_path    /data/webcache levels=1:2 keys_zone=one:10m inactive=1h max_size=10g;
  proxy_cache_valid any 10m;
  server {
  listen             80;
  server_name    localhost;
  root   html;
  index index.html;
  proxy_cache one;
  proxy_cache_key $uri$is_args$args;
  #proxy_cache_key $scheme$proxy_host$request_uri;
  location / {
  proxy_pass http://localhost;
  proxy_cache_purge PURGE from 127.0.0.1;
  }
  #location ~ ^/purge(/.*){
  #   proxy_cache_purge one $1$is_args$args;
  #}
  }

页: [1]
查看完整版本: nginx之proxy模块使用