Re[3]: проксирование в зависимости от внешнего IP

Дугин Сергей drug at qwarta.ru
Mon Aug 18 13:10:07 MSD 2008


Здравствуйте.

Так никто и не поможет?:(

Вы писали 15 августа 2008 г., 18:11:54:

> nginx version: nginx/0.5.34

> Ошибка повторяется

> 2008/08/15 18:10:20 [emerg] 49104#0: "proxy_pass" may not have URI
> part in location given by regular expression, or inside named
> location, or inside the "if" statement, or inside the "limit_except"
> block in /usr/local/nginx/conf/nginxdomain_log.conf:61

> 2008/08/15 18:10:20 [emerg] 49104#0: the configuration file
> /usr/local/nginx/conf/nginx.conf test failed

> вот как щас выглядит:
>       if ($ip_search)
>       {
>         proxy_pass http://10.0.0.3:80;
>         proxy_redirect off;
>         proxy_set_header Host $host;
>         proxy_set_header X-Real-IP $remote_addr;
>         proxy_set_header X-Forwarded-For $remote_addr;
>         proxy_set_header X-Accel-Internal /internal_bdbd_ru;
>         break;
>       }
>       proxy_pass http://10.0.0.2:80;
>       proxy_redirect off;
>       proxy_set_header Host $host;
>       proxy_set_header X-Real-IP $remote_addr;
>       proxy_set_header X-Forwarded-For $remote_addr;
>       proxy_set_header X-Accel-Internal /internal_bdbd_ru;
>       if ($ip_runet){return 403;}
>     }


> Вы писали 15 августа 2008 г., 17:18:59:

>> - proxy_pass http://10.0.0.3:80/;
>> + proxy_pass http://10.0.0.3:80;

>> Дугин Сергей пишет:
>>> Здравствуйте
>>> 
>>> Как сделать так чтобы в зависимости от внешнего IP я кидал на разные виртуальные хосты?
>>> Попробовал сделать как ниже получаю в ответ ошибку.
>>> 
>>>   geo $ip_search
>>>   {
>>>     default 1;
>>>     include /usr/local/nginx/conf/ip_search;
>>>   }
>>> 
>>> 
>>>   server {
>>>     listen 81.176.230.195:80;
>>>     server_name aaaa.ru www.aaaa.ru;
>>>     access_log /home/aaaa.ru/logs/access.log main;
>>>     location / {
>>>       access_log /home/aaaa.ru/logs/access.log main;
>>>       if ($ip_search)
>>>       {
>>>         break;
>>>         proxy_pass http://10.0.0.3:80/;
>>>         proxy_redirect off;
>>>         proxy_set_header Host $host;
>>>         proxy_set_header X-Real-IP $remote_addr;
>>>         proxy_set_header X-Forwarded-For $remote_addr;
>>>         proxy_set_header X-Accel-Internal /internal_bdbd_ru;
>>>       }
>>>       proxy_pass http://10.0.0.2:80/;
>>>       proxy_redirect off;
>>>       proxy_set_header Host $host;
>>>       proxy_set_header X-Real-IP $remote_addr;
>>>       proxy_set_header X-Forwarded-For $remote_addr;
>>>       proxy_set_header X-Accel-Internal /internal_bdbd_ru;
>>>       if ($ip_runet){return 403;}
>>>     }
>>>   }
>>> 
>>> 2008/08/15 15:37:54 [emerg] 47724#0: "proxy_pass" may not have URI
>>> part in location given by regular expression, or inside named
>>> location, or inside the "if" statement, or inside the "limit_except" block in /usr/local/nginx/conf/nginxdomain_log.conf:61  
>>> 
>>> 
>>>   







-- 
С уважением,
 Дугин Сергей                          mailto:drug at qwarta.ru
 QWARTA






More information about the nginx-ru mailing list