ПРОЕКТЫ 


  АРХИВ 


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 and if condition



Hello, All!
Возникла задача: пришел клиент с IP адреса 1.1.1.1 к нам с запросом
http://www.foo.bar - ему надо сделать proxy_pass на один бакэнд, а всем
остальным, пришедшим к нам с тем же самым запросом - сделать proxy_pass
на другой бакэнд.
Попробовал через:
if ($host ~ 1.1.1.1) {
   proxy_pass 1;
}
Не работает, ругается. :( Пробовал через:
location / {
   allow 1.1.1.1;
   deny all;
   proxy_pass 1;
}
location / {
   allow all;
   proxy_pass 2;
}
До второго location дело, похоже, не доходит. Все клиенты получают 404.

Есть ли еще какие-нибудь варианты?

-- 
Best regards, Andrey Y. Ostanovsky
St. Petersburg



 




Copyright © Lexa Software, 1996-2009.