$upstream_addr похоже пуст по время обработки запроса

J Channel jchannelx at gmail.com
Mon Oct 26 12:53:17 MSK 2009


Nginx 0.8.20 Windows.

Такая конструкция работает:
       location ~ "/127.0.0.1:(\d+)/(.+)" {
           proxy_pass http://127.0.0.1:$1/$2$is_args$args;
       }

       location / {
           proxy_pass http://frservers;
           proxy_redirect / /$upstream_addr/;
       }
Но если один из бакендов не ответил, то в $upstream_addr будет два адреса и
быть беде.

Такая вот конструкция не работает - $ua всегда пустой.

       location ~ "/127.0.0.1:(\d+)/(.+)" {
           proxy_pass http://127.0.0.1:$1/$2$is_args$args;
       }

       location / {
           proxy_pass http://frservers;
           if ( $upstream_addr ~ ", ([\d\.]:\d+)$" ) {
               set $ua $1;
           }
           proxy_redirect / /$ua/;
       }


А хочется, чтобы работала. Как?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx-ru/attachments/20091026/ee6af03b/attachment.html>


More information about the nginx-ru mailing list