������������ ��� ������������ ���� �������� � ����������� apache ��
������. map_regex ��� �� �������, ��� ��� � ���� ������ map_regex SRC DST1
DST2 DST3 ... � �������� ��������� �� DST's ������ 
map_regex SRC DST backup1 backup2 ... ������ � backupN � ���� ��
���������� ������������ regex �� ���� 10.0.0.1:$1 �������� ������ ��� DST.
�� � ������� ������ ������� �� �������, hash ������� ���������. map_regex
� map_acl � � ���� ����������� �� �����, ������� ��������� map (MAP_STRING
� ������), ��������� �������:

������� ������� �������� �����.
����� ���� ������� 
map src:port dst1:port1 dst2:port2

���� �� ���� �� ������ �� ����� ���� (���������� ����� �� ����, � 80), ��
��� ��� � ������

���� port=0 �� ��������� ���� ���: dst1:port1+(���� �������)
dts2:port2+(���� �������), �� ����:
  ���� ���� �������
  map ip:0 10.0.0.1:8000 10.0.0.2:8000
  � ��������� ����� ip:81 �� ��������� ������ ���������� �������
  map ip:81 10.0.0.1:8081 10.0.0.2:8081

���� port != 0 ��, ���� port{1,2,3...} != 0 �� ��� ��� ������, ����
port{1,2,3...} == 0 �� ��������� ������ �� dstN:(���� ������) �� ����:

���� ������� 
map ip:81 10.0.0.1:0 10.0.0.2:0
������ ���� �� ip:81
�� ��� ���������� �������
map ip:81 10.0.0.1:81 10.0.0.2:81

���� �������
map ip:0 dst1:0 dst2:0 ...
��� �������� 6 ������ ��� ���������, �������� ����� �������
map ip:8(.*) dst1:8$1 dst2:8$1
 
����� � ������, ������� ������ accel.c, ���� ������� �� CVS

--
Zherdev Anatoly.
--- accel.c.orig        Wed Aug 29 21:57:52 2001
+++ accel.c     Wed Sep  5 14:48:50 2001
@@ -675,6 +675,8 @@
            } else {
                use_name = host->name;
                use_port = host->port;
+               /* Added by Tolyar */
+               if ( !map->from_port || !use_port ) use_port = rq->url.port;
            }
            my_xlog(OOPS_LOG_HTTP|OOPS_LOG_DBG, "redir_connect(): Connecting to 
%s:%d\n", use_name, use_port);
            rc = str_to_sa(use_name, (struct sockaddr*)&server_sa);
@@ -824,7 +826,22 @@
        }
 
        /* 2. rewrite port part                 */
-       rq->url.port = map->to_hosts->port;
+
+       /*Changed by Tolyar*/
+
+       if ( map->from_port ) rq->url.port = map->to_hosts->port;
+       else rq->url.port=0;
+       
+       if ( !rq->url.port || !map->from_port )
+       {
+               char *tmp_port;
+               if ( (tmp_port=index(rq->original_host,':')) != NULL )
+               {
+                       rq->url.port=map->to_hosts->port + atoi(tmp_port+1);
+               } else rq->url.port=80;
+       };
+       
+       /*End of Changes*/
 
        /* 3. If need - rewrite path part       */
        if ( map->to_hosts->path && rq->url.path ) {

Дати відповідь електронним листом