apache being used as proxy server not working properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have scenario where serverA -> serverB(apache) -> serverC.

scenario we have is serverC can be any ipAddress which will be provided by
serverA in Request to apache.

Request send by serverA is  /Command1/10.10.10.10:80
I have define proxypass rules in my httpd.conf. Below are same

<VirtualHost *:80>
        KeepAliveTimeout 5
        MaxKeepAliveRequests 5
        Timeout 5
        KeepAlive on
        ProxyPreserveHost On
        ProxyTimeout 5
        ProxyRequests off
        

        ProxyPass /Command1/ip=(.*) http://$1/Command1
        ProxyPassReverse /Command1/ip=(.*) http://$1/Command1
        
</VirtualHost>

When I restart apache and send request i get error which i see in error logs
 AH00128: File does not exist: /somePath/Command1/ip=10.10.10.10:80


If I hardcode the ip in proxypass the everything works fine. 

But as I stated serving ip has to be picked from request send by serverA.


I then tried using Rewrite rule for proxy, which is as below
<VirtualHost *:80>
        KeepAliveTimeout 5
        MaxKeepAliveRequests 5
        Timeout 5
        KeepAlive on
        ProxyPreserveHost On
        ProxyTimeout 5
        ProxyRequests off

        RewriteEngine On
        
        RewriteRule /Command1/ip=(.*)  http://$1/Command1 [P]
</VirtualHost>
After using rewrite I'm able to forward request to serverC, but all the
request are not being send. Also in logs i see 
 AH02642: proxy: connection shutdown

Above message is logged aeverytime after apache had send request to serverC.

Could anybody please help me in resolving this.

What I'm looking for is all requests being propagated to correct server.

Thanks 



--
View this message in context: http://apache-http-server.18135.x6.nabble.com/apache-being-used-as-proxy-server-not-working-properly-tp5023061.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux