0

I set forward proxy server using apache mod_proxy, which connects to 20 other proxy servers using ProxyRemote feature.

You can set just one URL for ProxyRemote , in my case it's proxy.mydomain.com:8085

I set round-robin for this subdomain with 20 different proxy IP addresses. nslookup and ping proves that round-robin works properly.

When I use this setup ProxyRemote is using only machine from the closest subnet to its IP.

So for example if my machine is 91.123.123.123

and my proxies are

5.4.12.9

188.23.9.111

91.222.111.99

and so on...

it always uses 91.222.111.99 and never the others.

I have no idea why this happens and I really need one proxy machine which uses other 20 proxies.

The idea is to create one proxy machine which connects to the target URL with random IP everytime.

knm
  • 5
  • 2
  • The fact that the closest Proxy from the requested IP is used seems quite good to me...I mean, if you need to go from "New York" to "L.A", the use of a Proxy in "Denver" is more straight-forward than the use of a Proxy in "Paris". It would be interesting to test what happens if Proxy 91.222.111.99 is down...Do you run your test always from the same location ? – krisFR May 19 '15 at 00:50
  • Yes, I removed 91.222... from DNS round-robin and 5.8.... was in use all the time. I agree it's good but I set round-robin to make IP circle and each IP should be used , no matter location. My question is how to set apache NOT TO choose the closest location and respect round-robin order. – knm May 19 '15 at 09:59

1 Answers1

0

I just got hit by that problem. This is because getaddrinfo implements precedednce sorting with common prefix length as detailed in RFC3484/2.2.

You can adjust this behavior by editing /etc/gai.conf

Koder
  • 101
  • I use centos and it looks like I don't have gai.conf in /etc. The only location I found it is /usr/share/doc/glibc-common-2.5 , I can copy it to etc but then what should I uncomment/set to get it working ? – knm Oct 28 '15 at 12:27
  • do i need to type each ip there ? could you add more details. just read man gai.conf but still don't really understand how to config my ipv4 proxy IPs there. – knm Nov 01 '15 at 23:40