top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Revers proxy sync/async question

+2 votes
396 views

Does Apache in reverse proxy mode cache the complete response from the backend before forwarding it the client, or does it send the data to the client as it receives it? In other words, if the backend server only produced and transmitted a response, how would apache proxy server react?

posted Sep 5, 2013 by Naveena Garg

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+6 votes

I have a reverse proxy (apache 2.2) with mod_proxy_balancer with https visible to the outside world.

The question is: from the proxy performance/scalability point of view is it better to configure backends (origin servers) with http or with https?

Is it true that if proxy is setup https->http then it only has to decrypt/encrypt the headers and the body is encrypted/decrypted on the backend? I do not use mod_proxy_html (but maybe there are other modules which affect this behaviour on the proxy?.

How either setup affects latency of handling requests? With https->https do I have to do two handshakes (on the proxy and on the backend) for every connection? I have KeepAlive both on the proxy and the backends.

+1 vote

I have an idea how to setup Apache for doing load balancer based on mod_proxy and mod_balance modules. But in my case the backend server requires ssl client certificate authentication and therefore the Apache Server cannot terminate the ssl connection.

I do no need http session cookie stickyness. The application is stateless. Can I somehow configure Apache as a transparent balancer?

Or I should use even another software - squid, iptables? The backend application is a web service running on Tomcat.

+1 vote

1) I'd have a question on how to set up a reverse proxy to a http 1.0 in the cleanest most standard conforming way.

AFAIU, strict HTTP 1.0 has neither persistent connections / keep-alives
- a connection ends after a single request has been responded. Neither does it have Host: headers.

a) Do I need to tell the reverse-proxy about this? Do I have to set:
- ProxyPass' disablereuse=on and/or
- force-proxy-request-1.0 and/or
- proxy-nokeepalive and/or
- proxy-sendcl

Or is one of them enough? E.g. when I set force-proxy-request-1.0... all the others are implicitly set?

b) Do I need to set proxy-initial-not-pooled?
Cause I get the error mentioned there,... interestingly that seems to be independent of the backend/origin server... and dependent on the client.

c) So, strictly speaking, I could not use name-based vhosting, right?

2) Further, when a client talks to the reverse proxy in HTTP 1.0 it should get the reply in 1.0 either. And when it talk to it in 1.1, it should get it in 1.1.

Would Apache do this automatically, or would it answer a 1.0 request with a 1.1 response?
So do I have to set: force-response-1.0 ?

3) The origin server to which I connect is single threaded, i.e. it will only process one request at a time. So Apache shouldn't connect more than once concurrently, as it would simply block. How do I get this? The keep-alive options above probably don't help here... Is the solution to set ProxyPass' max=1 ?

+1 vote

The Barracuda load balancer has feature which enables it to recover a broken web connection. Let me explain the scenario; suppose that there exist two web servers behind the Barracuda load balancer and the user is downloading a file from one of the back-end web servers. Now, suppose that the active web server goes down, the Barracuda load balancer is capable of continuing the download from where it was broken using the other web server. Is it possible to achieve such a behaviour using mod_proxy_balancer? Are there exist any open source alternatives which can provide the same capability? If not, is anybody aware of any roadmap to achieve the same functionality using open source tools? Considering mod_proxy_balancer, what are the required steps to follow in order to add such a functionality?

+2 votes

I have a domain domain.com that points to a server. Now I have a subdomain sub.domain.com that points to another server that has Apache running and Tomcat. I want this subdomain to point to a application deployed on the Tomcat instance through ajp.

I have configured the following in httpd.conf:

   ServerName sub.domain.com 
   ProxyRequests Off
   ProxyPreserveHost On  
   Order deny,allow Allow from all  
   ProxyPass / ajp://localhost:8009/ 
   ProxyPassReverse / ajp://localhost:8009/   

and in Tomcats server.xml:

But when I go to sub.domain.com the url changes to otherdomain.com and shows me a php website running in Apache and declared as following in httpd.conf:

 DocumentRoot /var/www/html/otherdomain.com 
 ServerName otherdomain.com 
 ServerAlias www.otherdomain.com 

I only get it to work when I change the port in the sub.domain.com virtual host declaration to for example 8001. Then when I go to sub.domain.com:8001 it shows my tomcat application (ROOT.war) as expected.

So my question is: what could be going wrong that it doesn't work with the default port 80? I can't find any configuration that is causing this, but I'm probably missing something or is my virtual host configuration wrong?

...