Re: proxy cache limit conn

Alexander Goncharov alexander.gsander gmail.com
17 13:54:13 UTC 2012


  ,  limit_req     .

    random flood,    
   (   ) ,  
flood.

  .

2012/2/2 ya <nginx-forum at nginx.us>:
> ,
>   
>    
> (limit_conn),      
> (proxy_cache)   :)
>     :
>
> limit_zone perserver $server_name 1m;
>
> location /search/ {
>    rewrite  ^/search/(.+)/$      /search.php?q=$1&content=1
> break;
>    expires 10m;
>    proxy_ignore_headers "Cache-control" "Expires";
>    proxy_cache test;
>    proxy_cache_valid 200 301 302 304 1d;    #kak chasto
> obnavlyat`
>    proxy_cache_use_stale updating error timeout invalid_header
> http_500 http_502 http_503 http_504 http_404;
>    proxy_cache_key "$host|$request_uri";
>
>    proxy_pass http://forontend; #  
>    proxy_redirect off;
>    proxy_intercept_errors on;
>    proxy_set_header Host $host;
>    proxy_set_header RealIP $remote_addr;
>
> }
>
> location /search.php {
>    limit_conn perserver 5;
>
>    proxy_pass http://backend;
>    proxy_redirect off;
>    proxy_intercept_errors on;
>    proxy_set_header Host $host;
>    proxy_set_header X-Real-IP $http_RealIP;
> }
>
>  .
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?21,221875,221875#msg-221875
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru


nginx-ru