ПРОЕКТЫ 


  АРХИВ 


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]

Переменные в proxy_pass


  • To: nginx-ru@xxxxxxxxx
  • Subject: Переменные в proxy_pass
  • From: J Channel <jchannelx@xxxxxxxxx>
  • Date: Wed, 22 Jul 2009 16:13:21 +0000
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=ICcpnxTIXi4rRgzJWIbxG9mgOz6tdxbg5H0QyXOovm8=; b=SXTB3Lg/PQZWLtD09AGCv6pOExphnaKCF2Oahn0oyd7odOVyqGG+WS5VAAcuz09x7L E1K3L7uR/PsekpXQm9o3ojqvrDFbpeYncCrqAauTXiBzdazAv7u1KJ5SQ+3WsPWUsnHk mxcxwGMvuTjHdpNN8Ti00d7F03F68SltFikcU=
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=ek5LAUQWRFTfEaCM18bfJekT575FhSPMyPF4vUkHdHDOsZ7Qcs5Pgo74a4E+KzwqwW euYz+p+ZO9TV1H2V9uSmHAiarvgFPN8lbrdYB7cJXNIEAA/p+jqzutSvirdmiUR4sXDa 7y+OIrRqXGP+0u4xR1aqm0eb4CApTywa6p6bI=

Привет!
Бекенды кладут в куку JSESSIONID постоянную часть, каждый свою.
Например k3t2 - это сервер номер 3, томкат на порту 8020
Хочется заворачивать клиентов по этим данным.
Написана такая конфигурация
             if ( $cookie_JSESSIONID ~ k(\d)t(\d)$ ) {
                 set $i $1;
                 set $p $2;
                 proxy_pass  "http://10.0.0.${i}:80${p}0";
             }
Получаю 500 ошибку
Текст дебаглога:

2009/07/22 19:58:02 [notice] 22554#0: *265 "k(\d)t(\d)$" matches "C8E1CD03759419B1D76EB8BCC576DCD9.k3t2", client: 10.1.1.180, server: testhost.com, request: "GET /book/nginx-logo.png HTTP/1.1", host: "testhost.com", referrer: "http://testhost.com/serv/"
2009/07/22 19:58:02 [debug] 22554#0: *265 http script if
2009/07/22 19:58:02 [debug] 22554#0: *265 http script complex value
2009/07/22 19:58:02 [debug] 22554#0: *265 http script capture: "3"
2009/07/22 19:58:02 [debug] 22554#0: *265 http script set $i
2009/07/22 19:58:02 [debug] 22554#0: *265 http script complex value
2009/07/22 19:58:02 [debug] 22554#0: *265 http script capture: "2"
2009/07/22 19:58:02 [debug] 22554#0: *265 http script set $p
2009/07/22 19:58:02 [debug] 22554#0: *265 post rewrite phase: 3
2009/07/22 19:58:02 [debug] 22554#0: *265 generic phase: 4
2009/07/22 19:58:02 [debug] 22554#0: *265 generic phase: 5
2009/07/22 19:58:02 [debug] 22554#0: *265 access phase: 6
2009/07/22 19:58:02 [debug] 22554#0: *265 access: B401010A FFFFFFFF 151F3AD4
2009/07/22 19:58:02 [debug] 22554#0: *265 access phase: 7
2009/07/22 19:58:02 [debug] 22554#0: *265 post access phase: 8
2009/07/22 19:58:02 [debug] 22554#0: *265 malloc: 0000000014F2C2D0:4096
2009/07/22 19:58:02 [debug] 22554#0: *265 http script copy: "http://10.0.0."
2009/07/22 19:58:02 [debug] 22554#0: *265 http script var: "3"
2009/07/22 19:58:02 [debug] 22554#0: *265 http script copy: ":80"
2009/07/22 19:58:02 [debug] 22554#0: *265 http script var: "2"
2009/07/22 19:58:02 [debug] 22554#0: *265 http script copy: "0"
2009/07/22 19:58:02 [debug] 22554#0: *265 http init upstream, client timer: 0
2009/07/22 19:58:02 [debug] 22554#0: *265 epoll add event: fd:9 op:3 ev:80000005
2009/07/22 19:58:02 [error] 22554#0: *265 zero length URI to proxy, client: 10.1.1.180, server: testhost.com, request: "GET /site/nginx-logo.png HTTP/1.1", host: "testhost.com", referrer: "http://testhost.com/serv/"

Можно ли реализовать такую функциональность штатными средствами, или надо писать патч?


 




Copyright © Lexa Software, 1996-2009.