load balancing between few auth_http records

Anton Yuzhaninov citrin at citrin.ru
Wed Jul 11 13:17:43 MSD 2007


Hello umask,

You wrote on Wednesday, July 11, 2007, 12:36:59 PM:

u> подскажите, пожалуйста, возможно ли использовать несколько записей
u> auth_http и если можно, то как распределить между ними нагрузку?

Можно сделать так:

http {
    log_format mail '[$time_local] $http_auth_user from $http_client_ip by $http_auth_protocol status: "$sent_http_auth_status
" backend: $sent_http_auth_server:$sent_http_auth_port attempt: $http_auth_login_attempt auth: $http_auth_method';
    access_log  /spool2/logs/nginx/access.log mail;

    upstream auth-nginx-cluster {
        server auth1.example.ru:8080;
        server auth2.example.ru:8080;
        server auth3.example.ru:8080;
        server auth4.example.ru:8080;
    }

    server {
        listen       127.0.0.1:7000;
        server_name  localhost;

        location /cgi-bin/ {
                proxy_pass http://auth-nginx-cluster/cgi-bin/;
                proxy_connect_timeout  5s;
                allow 127.0.0.1/32;
                deny  all;
        }

    }
}

mail {
    auth_http    127.0.0.1:7000/cgi-bin/nginx-auth.cgi;
    ...
}

-- 
 Anton Yuzhaninov.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1781 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://nginx.org/pipermail/nginx-ru/attachments/20070711/25adab90/attachment.bin>


More information about the nginx-ru mailing list