ðòïåëôù 


  áòèé÷ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  óôáôøé 


  ðåòóïîáìøîïå 


  ðòïçòáííù 



ðéûéôå
ðéóøíá












     áòèé÷ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: recursive_error_pages limited to a chain of 11?



Hi Maxim,

   I have just tried - and it works - though more questions raise, how is
the round-robin working (though, since I am using cache, I am not too
concerned)  Also, is there a limit to the number of maximum upstream servers
within the block - from the documentation I don't see any indicative of
having limits - but this is something I wont have to worry for a long time.


nginx.conf

#user  nobody;
worker_processes  5;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

pid        /var/run/nginx.origin.pid;


events {
    worker_connections  10000;
}

http {
    include       /etc/nginx.origin/mime.types;
    default_type  application/octet-stream;
    recursive_error_pages               on; 

        log_format main '-->$upstream_cache_status<-- | '
        '$remote_addr - $remote_user [$time_local]  "$request" '
        '| Upstream_Address "$upstream_addr" '
        '| upstream_response_time $upstream_response_time '
        '| msec $msec request_time $request_time '
        '| OriginServer $upstream_addr';
        
        log_format cache '***$time_local '
        '-->$upstream_cache_status<-- '
        'Cache-Control: $upstream_http_cache_control '
        'Expires: $upstream_http_expires '
        '"$request" ($status) '
        '"$http_user_agent" ';
        
        #access_log  logs/cache.log cache;
        
        access_log  /var/log/nginx/origin.nas.access.log  main;

   sendfile        on;
   keepalive_timeout  65;
                
        # Hide version information
   server_tokens off;
        
        #headers
        add_header Upstream-Host        $upstream_addr;
        add_header Cache-Status         $upstream_cache_status;
        
        #Include proxy config
        client_body_buffer_size  512k;
        proxy_connect_timeout    5;
        proxy_read_timeout       60;
        proxy_send_timeout       5;
        proxy_buffer_size        16k;
        proxy_buffers            4 64k;
        proxy_busy_buffers_size 128k;
        proxy_temp_file_write_size 128k;

        proxy_cache_path 
        /etc/nginx.origin/cache/maincache/cache levels=1:2      
keys_zone=nginx_cache:500m      inactive=30m
max_size=120g;
        proxy_temp_path         /etc/nginx.origin/cache/temp; 

        #proxy_cache_key "$host$request_uri$cookie_user";
        proxy_cache_key "$request_uri";

        proxy_cache_valid  200 302  60m;
        proxy_cache_valid  404          0s; 
        
        upstream setA {
                server 192.168.30.9:10666;
                server 192.168.31.79:10666;
                server 192.168.72.109:10666;
                server 192.168.72.110:10666;
                server 192.168.72.201:10666;
                server 192.168.72.127:10666;
                server 192.168.72.128:10666;
                server 192.168.72.137:10666;
                server 192.168.31.238:10666;
                server 192.168.72.134:10666;
                server 192.168.72.139:10666;
                server 192.168.76.110:10666;
                server 192.168.72.141:10666;
                server 192.168.72.126:10666;
                server 192.168.76.103:10666;
                server 192.168.73.90:10666;
                server 192.168.73.91:10666;
                server 192.168.38.88:10666;
                server 192.168.38.89:10666;
        }
        
    server {
        listen       haproxy-local:10777;
        server_name  localhost;
        
        #This setting has to sit here in order to support
        # more than
        recursive_error_pages           on; 
                # UNCOMMENT BELOW TO ENABLE CACHE
                #proxy_cache nginx_cache;
                proxy_cache_valid  200 304 12h;
                expires      1d; 
                
                location /
                {
                        access_log  
/var/log/nginx/origin.handler.f.proxy_access.log  main;
                        #If 404, check next server set. If last, it should go 
to error page.
                        #error_page 404 502 503 504 /404.html;
                        #error_page 404 /404.html;
                        proxy_pass http://setA;
                        proxy_set_header Host $host;
                        proxy_set_header X-Real-IP $remote_addr;
                        proxy_set_header X-Forwarded-For 
$proxy_add_x_forwarded_for;
                        proxy_connect_timeout 60s;
                        proxy_next_upstream error timeout http_500 http_502 
http_503 http_504
http_404;
                        proxy_intercept_errors on;
                        
                }
                
                error_page   500 502 503 504  /50x.html;
                location = /50x.html {
                        root   html;
                }
          
                location = /404.html {
                        root            html;
                }
                
                location = /crossdomain.xml {
                        access_log  
/var/log/nginx/origin.handler.crossdomain.proxy_access.log 
main;
                        root            html;
                }
    }


}

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,231038,231047#msg-231047

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.